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...

CommentFileSizeAuthor
#1 1806142-restws-property-exception.patch757 bytesklausi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

klausi’s picture

Version: 7.x-2.0-alpha2 » 7.x-2.x-dev
Status: Active » Needs review
Issue tags: +Needs tests
FileSize
757 bytes

Thanks 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.

haggan’s picture

Sweet thanks!

I can now get json formats!

Many thanks for the patch!

klausi’s picture

Status: Needs review » Needs work
Issue tags: -Needs tests +D7 stable release blocker

Tagging. Needs work for a test case, any volunteers?

klausi’s picture

Issue tags: +Needs tests

Keeping the needs tests tag.

Tim.Jongsma’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community

We 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!

klausi’s picture

Status: Reviewed & tested by the community » Needs work

Glad it works for you - can you write a simpletest for this?

Tim.Jongsma’s picture

Well 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.

jeff h’s picture

This 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?

jeff h’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs tests

This has been running on our production environment for almost a year without issue. Please merge it.

  • klausi committed a8ff585 on 7.x-2.x
    Issue #1806142 by klausi: EntityMetadataWrapperException: This node is...
klausi’s picture

Status: Reviewed & tested by the community » Fixed

Alright, committed.

Status: Fixed » Closed (fixed)

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