Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I just enable the book module.
When trying to request a json page on a node I get this.
EntityMetadataWrapperException: This node is no book page. in entity_metadata_book_get_properties() (line 24 of /var/www/html/sites/all/modules/entity/modules/callbacks.inc).
Sorry if it is a duplicate...
Comment | File | Size | Author |
---|---|---|---|
#1 | 1806142-restws-property-exception.patch | 757 bytes | klausi |
Comments
Comment #1
klausiThanks for reporting, problem confirmed.
Looks like we need to catch exceptions when we filter out properties that should not be accessed.
Patch attached, please test.
This should also come with an automated test case using the book module.
Comment #2
haggan CreditAttribution: haggan commentedSweet thanks!
I can now get json formats!
Many thanks for the patch!
Comment #3
klausiTagging. Needs work for a test case, any volunteers?
Comment #4
klausiKeeping the needs tests tag.
Comment #5
Tim.Jongsma CreditAttribution: Tim.Jongsma commentedWe had precisely the same error, this patch works as a charm. we recommend this will be added to the main branch.
Thanks for the patch!
Comment #6
klausiGlad it works for you - can you write a simpletest for this?
Comment #7
Tim.Jongsma CreditAttribution: Tim.Jongsma commentedWell at this moment i'm experiencing other issues, which make it a bit hard to test anything. i have created another issue about that, so if i can get this module to work, i'm willing to give it a try.
Comment #8
jeff h CreditAttribution: jeff h commentedThis patch looks fine and is an incredibly simple fix.
It took me a good while with my debugger to even realise I had the book.module problem that this fixes. I suspect many would have given up, blaming the restws module.
Surely it's not worth holding up including this patch for almost two years just because there's no test? I admire the sentiment but pragmatically, I don't think anyone's going to write a test for this.
Can you please roll it in?
Comment #9
jeff h CreditAttribution: jeff h commentedThis has been running on our production environment for almost a year without issue. Please merge it.
Comment #11
klausiAlright, committed.