#2880149: Convert taxonomy terms to be revisionable just landed in 8.7.x and 8.8.x.
I noticed the patch updated some REST test coverage in /core/modules/taxonomy/tests/src/Functional/Rest/TermResourceTestBase.php
It also added 2 new validation constraints:
/core/modules/taxonomy/src/Plugin/Validation/Constraint/TaxonomyTermHierarchyConstraint.php
/core/modules/taxonomy/src/Plugin/Validation/Constraint/TaxonomyTermHierarchyConstraintValidator.php
Perhaps JSON:API needs/wants to update/expand its test coverage to follow-suit?
I haven't dug closely into the details, but I wanted to open an issue to put it on your collective radar if it wasn't already. A quick search in here didn't reveal any existing issues about this. Apologies in advance if this is duplicate.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3039235-10.patch | 7.78 KB | wim leers |
| #10 | interdiff.txt | 7.17 KB | wim leers |
| #8 | 3039235-7.patch | 7.23 KB | wim leers |
Comments
Comment #2
xjmThanks @dww!
As far as I know, JSON:API currently hardcodes that only nodes and media are "versionable" resource types, in:
\Drupal\jsonapi\ResourceType\ResourceTypeRepository::isVersionableResourceTypeNot sure if or how this was impacted by the change in #3038453: When RevisionableEntityBundleInterface::shouldCreateNewRevision is TRUE, create a new revision on PATCH requests and add an entry in the revision log., though.
Comment #3
volegerAlso meny_link_content become revisionable in 8.7.0 #2880152: Convert custom menu links to be revisionable
Comment #4
wim leersTermorMenuLinkContentrevisions just yet. See Workflow Initiative maintainer (and the lead on those two mentioned core issues) @amateescu confirm this in #2992833-151: Add a version negotiation to revisionable resource types.You'll see that #2880149: Convert taxonomy terms to be revisionable and #2880152: Convert custom menu links to be revisionable didn't add new access control logic to match that in
\Drupal\node\Access\NodeRevisionAccessCheckor\Drupal\media\Access\MediaRevisionAccessCheck, so JSON:API is also unable to add support for either of them.\Drupal\Core\Entity\RevisionableEntityBundleInterface(which is what has thatshouldCreateNewRevision()method), then we should look into expand their test coverage.But
Term's bundle entity typeVocabulary's interface\Drupal\taxonomy\VocabularyInterfacedoesn't implement this andMenuLinkContentdoesn't have a bundle entity type. So, no work to be done there either.Hence marking this fixed. Crediting all people who contributed to this issue to ensure JSON:API is as complete as it can possibly be, to thank you for your thoughtfulness ❤️ 👏
Comment #5
dwwSeems like this was marked 'Fixed' prematurely, given #2843147-170: Add JSON:API to core as a stable module and #3015325-49: [ignore] support issue for the core patch ;)
But cool, it seems it's all at least on the way to being fixed now. :)
Cheers,
-Derek
Comment #6
wim leersYep, no functional changes, but tests are indeed failing. Those will need fixing. https://www.drupal.org/pift-ci-job/1225896
Comment #8
wim leersI ported @amateescu's patch at #3015325-49: [ignore] support issue for the core patch to the JSON:API contrib module, which unlike the core patch, also needs to support Drupal 8.5 and 8.6. For now, I only resolved the conflicts to apply to the contrib module's code which also has 8.5 and 8.6 code paths (which resulted in conflicts).
Oh, and I checked all functional changes and can confirm they make sense :)
This will not pass on 8.5 and 8.6, since this patch is making 8.7-specific assumptions.
Comment #10
wim leersThis fixes the 8.6 and 8.5 failures.
Comment #11
amateescu commentedSo.. the reason I wrote those fixes as an interdiff to the core patch is because I assume that at least the 8.x-2.x branch of the contrib module won't have to support the 8.7.x core branch after it gets committed, right?
Comment #12
wim leersSo: you're right, but we aim for maximum compatibility and minimal disruption :)
Comment #13
wim leers#10 came back green on 8.5 + 8.6 + 8.7. 🚢
Comment #15
wim leers