Installation of NodeOwnership worked fine. If I klick on the link to claim ownership I get following error:
The website encountered an unexpected error. Please try again later.
Recoverable fatal error: Argument 1 passed to Drupal\workbench_moderation\ModerationInformation::isModeratableEntity() must implement interface Drupal\Core\Entity\EntityInterface, string given, called in xxx/xxx.xxx.at/modules/workbench_moderation/src/Plugin/Menu/EditTab.php on line 81 and defined in Drupal\workbench_moderation\ModerationInformation->isModeratableEntity() (line 54 of modules/workbench_moderation/src/ModerationInformation.php).
Comment | File | Size | Author |
---|---|---|---|
#18 | workbench_moderation-fix_compatible-2769119-18--TESTONLY.patch | 5.08 KB | scott_euser |
#6 | workbench_moderation-edit_tab-2769119-6.patch | 3.19 KB | becw |
#2 | workbench_moderation-fix_compatible-2769119-2.patch | 801 bytes | myLies |
Comments
Comment #2
myLies CreditAttribution: myLies as a volunteer commentedlooks like in EditTab class in method getRouteParameters gets entity from route
And seems like when enabled NodeOwnership in route contains entity_id but must be a entity object
I made a simple patch to check and load entity if it not an object
Comment #5
becw CreditAttribution: becw at Palantir.net commentedI have a similar error with the EditTab class, when I place a view at
node/%node/foo
. Views isn't processing the%node
route placeholder into a Node object, so when EditTab looks at its "entity" property, it sees an int instead of a node object.Comment #6
becw CreditAttribution: becw at Palantir.net commentedFollowing up to the patch in #2, here's a version of the patch that uses dependency injection.
Comment #7
becw CreditAttribution: becw at Palantir.net commentedComment #10
trevortwining CreditAttribution: trevortwining as a volunteer commentedI've applied #6 patch and it fixes the issue for me. My issue is the same problem but a different (custom) module that creates a
node/{ node }/foo
path. Thanks for this, @becw ! I'm also using PHP 5.6, so I'm not sure why it's failing the 5.6 test.Comment #11
Erik FrèrejeanI ran into this issue, with a view. The patch #6, resolves the issue.
Comment #12
scott_euser CreditAttribution: scott_euser as a volunteer and at Fat Beehive commentedThe patch in #6 also sorts it for me. Essentially this happens with any module that adds its own local task even if using the identical format to the drupal code node module adding the version tab as far as I can tell:
core/modules/node/node.routing.yml:
node.links.task.yml
Comment #13
scott_euser CreditAttribution: scott_euser as a volunteer and at Fat Beehive commentedSeems when requesting a retest the tests pass.
Comment #14
scott_euser CreditAttribution: scott_euser as a volunteer and at Fat Beehive commentedI've gone through the code in detail and see no issues. I don't think injecting more dependencies into the constructor would be a breaking change. After review & confirmation from 3 people that the patch solves it I am switching this to RTBC.
Comment #15
keboca CreditAttribution: keboca as a volunteer commentedPatch #6 works like a charm! It solved the issue that I was facing! Thx @becw
Comment #16
larowlanShould we be adding a test for this?
Comment #17
darvanen+1 for commit, but yeah... this could probably use a test.
My test setup is broken atm but I'll revisit this in a couple of weeks once I find the time to get it working again.
Comment #18
scott_euser CreditAttribution: scott_euser as a volunteer and at Fat Beehive commentedFor my error case, this appears to have been fixed (perhaps the requirements of the constructor in core have been updated). This test would have failed below.
Perhaps someone who still has the issue can update the below test to prove failure then apply it to the patch in #6.
Comment #19
sivaguru_drupal CreditAttribution: sivaguru_drupal commentedGiven patches is not working for me. I am still facing this issue at workbench 8.x-1.6 while creating custom tabs in node form.