Book nodes have metadata indicating their place in the book tree returned with them, but it is not possible to specify this metadata during node creation because the metadata setter callback is not defined. This patch adds the setters so book nodes can be created with the parent and book ID.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, entity-book-create.patch, failed testing.

akalsey’s picture

Looks like the test is the problem. The hook_entity_property_info_alter() that already exists in the module defines the type for book_ancestors as 'list<node>', but the tests don't handle this type. So when the setter runs, the test fails when trying to create that type.

I'll see about fixing the test.

akalsey’s picture

Status: Needs work » Needs review
FileSize
2 KB

list<node> seems to be just a list of ids, so I've added a random number as the type. Tests pass, doesn't break any other tests, but this doesn't seem the right way to do it. Any better ideas?

Chris Matthews’s picture

The 4 year old patch in #3 applied cleanly to the latest entity 7.x-1.x-dev and (if still relevant) needs review.