The D8 version for this module is avalaible at -> https://github.com/Insasse/comment_limit/tree/8.x
It is an early version please be patient and test it locally.

Comments

Insasse created an issue. See original summary.

didebru’s picture

I've also tested it with 8.2.x-dev and create a seperate branch to track issues for this version , too.

dawehner’s picture

Conceptually its a bit weird that we are doing something on hook_entity_insert(), see https://github.com/Insasse/comment_limit/blob/8.x/comment_limit.module#L107

I think a better approach would be to use a constrain, see https://www.drupalwatchdog.com/volume-5/issue-2/introducing-drupal-8s-en... for a detailed description about them.

didebru’s picture

So you want me to replace this hook , but with what? *sigh* I don't get it.
Yay I did it and it works just fine :)

didebru’s picture

Actually sanduhrs had a great idea.
I should disable/override the form when the limit for node/user is reached instead of let the user fill out and than say "No ur comment and work was for nothing".

didebru’s picture

I pushed my changes and it works pretty good :)

ivnish’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.