Hello,
We get this following error when trying to display an earlier revision.
Fatal error: Call to a member function get() on a non-object in www/modules/permissions_by_term/src/KernelEventListener.php on line 34
Steps to reproduce :
- drupal core 8.2.3
- permissions_by_term 8.x-1.08
Go into revisions tab of a node, and click on an earlier revision to display it.
Same error occured when we want to revert an earlier revision.
Thx,
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | permissions_by_term-error-displaying-node-revisions-2831836-6-8.2.3_0.patch | 905 bytes | zanvidmar |
| #7 | permissions_by_term-error-displaying-node-revisions-2831836-6-8.2.3.patch | 902 bytes | jozzy_a |
Comments
Comment #2
nicolas.hod commentedComment #3
jozzy_a commentedI have added a patch which should fix things.
There is now an additional check to see if the node value contains an array. Revisioned nodes only contain a single value rather than an array.
Joz
Comment #4
jozzy_a commentedComment #5
jepster_I cannot see any additonal check by your patch. Also the node variable stays unused because of the immediate return statement after the declaration. This needs work. Personally I would prefer code which is testable by PHPUnit.
Comment #6
jozzy_a commentedComment #7
jozzy_a commentedComment #8
jozzy_a commentedApologies for that jepSter, I didn't export the patch properly.
On comment #7 I have added a patch which checks to see if the node attribute is an array. When it is a node an entity is returned. When it is on the revision pages it only returns a single value.
Joz
Comment #10
jepster_Fixed in 8.x-1.10. Thanks for the solution suggestion and the reporting. Please test the latest version.
Comment #12
zanvidmar commentedHi, previous patch (#7) is missing closing parenthesis in if sentence. I am adding the new one.
Comment #13
nicolas.hod commentedhi,
I tried with 8.x-1.11 version, but with this patch and it solved my problem.
Thx,