- First commit to issue fork.
- @smulvih2 opened merge request.
- Status changed to Needs review
over 1 year ago 3:38pm 3 July 2023 - π¨π¦Canada smulvih2 Canada π
I am using the drupal/default_content_deploy β module for content deployment, which uses drupal/hal for normalizing the content into JSON files. I was running into the same issue where the book data was not being included in the output JSON files.
The issue appears to be how the book structure is attached to the node, it is not a field but just a simple array. MR#3 adds a book
normalizer
and
denormalizer
class to export/import the book structure with dependencies (_embedded).I had some trouble merging the book
_embedded
array into the main_embedded
array, so I have included the book dependencies within the book array. I had to modify the ContentEntityNormalizer::denormalize() method to account for this.Setting this ticket to Needs review to get some eyes on it, but this change will probably require a test, and maybe some dependency injection work.
- π¨π¦Canada smulvih2 Canada π
Had to rebase the MR branch but looks good now.
- last update
over 1 year ago 447 pass, 102 fail - π¨π¦Canada smulvih2 Canada π
MR is against the 1.0.x branch and I can't seem to change that, but this branch seems to be aligned with the 2.0.0 release. Adding patch here for 1.0.3 release (1.x branch).
The last submitted patch, 23: hal-add-book-support-2291811-23.patch, failed testing. View results β
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- Status changed to Needs work
over 1 year ago 10:43pm 3 July 2023 - π¨π¦Canada smulvih2 Canada π
Oops, forgot to account for when the book module is not enabled. Added a check before calling the
book.manager
service. - last update
over 1 year ago 704 pass - Status changed to Needs review
over 1 year ago 11:21pm 3 July 2023 - π¨π¦Canada smulvih2 Canada π
Ok tests are passing now on 1.x-dev branch for D9. Added this fix to the MR for 2.x-dev.
- Status changed to Needs work
over 1 year ago 7:18am 4 July 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
This should be doable without needing to add special cases to the content entity normalizer.
Entity pilot module also relied on hal, and it had a single stand alone class for books - https://git.drupalcode.org/project/entity_pilot/-/blob/8.x-1.x/src/Norma...
It also had a test, we should be able to borrow from that too https://git.drupalcode.org/project/entity_pilot/-/blob/8.x-1.x/tests/src...
- π¨π¦Canada smulvih2 Canada π
@larowlan thanks for the feedback and links! Will take a look at removing the changes to the ContentEntityNormalizer as you suggest and including tests as well.