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.
Tests needed for:
Updating book node types.
Setting another node type to be a book page type.
Comment | File | Size | Author |
---|---|---|---|
#11 | book_update.patch | 4.68 KB | kleinmp |
#5 | book_test.patch | 8.13 KB | beeradb |
#3 | book.test.patch | 8.21 KB | beeradb |
#1 | book_test.patch | 5.42 KB | beeradb |
Comments
Comment #1
beeradb CreditAttribution: beeradb commentedHeres a stab at this...
patch does the following:
* checks editing of book nodes. These edits modify the book structure
* adds an additional content type as a book page type, checks to ensure it can add this content type to the book outline
* checks the addition of a content type as the default book child page type
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commented@beeradb: I also have a patch that could be quite similar in #299136: Add tests for deleting and editing book pages. Could you try to merge the two?
Comment #3
beeradb CreditAttribution: beeradb commentedUpdated. Merged the parts of Damien's patch which weren't covered by my first one (deletion and the associated checks), and made the new book page type and default book page type tests use a dynamically generated content type. Interestingly enough I think I may have uncovered a bug in either core or the testing framework through doing this. After calling drupalWebTestCase::drupalCreateContentType() I have to do a menu_rebuild() to go to 'node/type/$type'. This rebuild is typically handled by node_type_form_submit which is never called in this context.
There are three options here...
depending on feedback here I'll either roll a patch for this or not. I think it probably shouldn't be the tests responsibility personally :).
Otherwise, I'd appreciate feedback on the rest of this patch as well.
Comment #4
beeradb CreditAttribution: beeradb commentedComment #5
beeradb CreditAttribution: beeradb commentedAfter a chat with chx on irc I've gone with option #1, "The menu_rebuild should be moved to node_types_rebuild.".
This patch is now dependent on #306316: Regression: node_types_rebuild should rebuild menu
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedThe last submitted patch failed testing.
Comment #7
beeradb CreditAttribution: beeradb commentedFairly certain this failed testing due to the listed dependencies. It would still be nice to have this reviewed.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedThe last submitted patch failed testing.
Comment #9
beeradb CreditAttribution: beeradb commentedwith #306316: Regression: node_types_rebuild should rebuild menu now committed, marking this back to CNR
Comment #11
kleinmp CreditAttribution: kleinmp commentedI rerolled this patch against the latest Drupal HEAD. I have not tested it locally, though.
Comment #12
calebgilbert CreditAttribution: calebgilbert commentedThis is failing fairly spectacularly in local testing (all book tests results in 292 passes, 9 fails, and 17 exceptions). I hit the bot for a retest. Will try and check back to see how that goes and re-roll unless someone beats me to it.
Comment #13
calebgilbert CreditAttribution: calebgilbert commentedOk, just figured out that there is an error which is keeping the testing bot from running the book.test at all:
Fatal error: Cannot use object of type stdClass as array in /Library/WebServer/Documents/botsite/modules/book/book.test on line 121
Will fix and re-roll patch and post in a bit unless someone else beats me to it.
UPDATE: Still working on this - the last patch post was quite a mess and not well commented. Taking forever actually. If someone gets impatient I'm glad to post my progress to date, otherwise will try to post a proper patch when I can.
Comment #14
catchMoving this out of the critical bugs queue - see #607038: Meta issue: fix gaps in code coverage.