Problem/Motivation
From what I can tell, searching and replacing on a paragraph doesn't create a new parent/grandparent (node) revision.
Steps to reproduce
1. Fresh install of D10
2. Paragraphs - 8.x-1.16
3. ERR - 8.x-1.11
5. Create a new paragraph type
6. Keep it basic, single plain text field
7. Have a content type with an ERR field that can reference the new paragraph, set this content type to create a new revision by default
8. Add a node of this type, with a paragraph, use dummy text for the single field value
9. Create a few revisions just for reference
10. Configure Scanner for this content type and paragraph
11. Search for the string added in step 8
12. Replace with something new
Expected
A new revision should have been created with the replaced values
Actual
Although the node has been updated, the last revision has been updated rather than create a new one. Im also not seeing a revision log message. Thirdly, the last revision and node updated time isn't updated to the timestamp of the replace.
Scratch that, a new revision IS created, as can be seen by going to the revisions tab, finding the latest and then iterating +1 - so its more like the revision isn't displayed in the revisions table rather than it not being created.
Compare the above behaviour to a content type with a single text field, every scan and replace in this scenario has the last updated time, revision log, revision etc all nicely in the revisions table.
Not sure if this is config, but I've tried it in a project and a fresh D10 spinup and im seeing the same behaviour.
Issue fork scanner-3418888
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3418888-replacing-on-a
changes, plain diff MR !29
Comments
Comment #2
aaron.ferris commentedComment #3
aaron.ferris commentedComment #4
aaron.ferris commentedComment #5
aaron.ferris commentedComment #6
aaron.ferris commentedComment #7
aaron.ferris commentedFrom what I can gather, this is related to revision_translation_affected not being set for the various VIDs. Which is odd, as this is a single language site.
At this point im not sure if this is a Scanner, ERR or Paragraphs issue.
I can see that when Scanner updates a paragraph, the node revision that's created has 'null' for revision_translation_affected, which consequently causes the following check to return FALSE, and the revision doesn't display in the revision list.
if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {from
NodeController->revisionOverview()Comment #8
nicholassComment #10
simeonkesmev commentedAdded work in progress work addressing
- Proper creation of new revisions, thus fixing the reported issue
- Fixing multivalue fields
- Fixing string fields handling
- Avoid error on paragraph parent entities, that are not paragraphs - such as Library items from the paragraph library
- Some tidying up
todo:
- Multiple revisions are currently created for every change to a single entity, could be related to other modules/workflow moderation on my testing environment.
Comment #11
joseph.olstadNice work on the branchsee comments below.For anyone wanting to test it, here's the patch
https://git.drupalcode.org/project/scanner/-/merge_requests/29.patch
Comment #12
joseph.olstadHmm, ya, the merge request removes language support which is
definatelylikely going to break things however please do continue as perhaps language support can be re-added after this is nailed down solid.Comment #14
smustgrave commentedCan we update for 2.0.x please.
Comment #15
damienmckennaComment #16
damienmckennaTrying to make 2.0.0 very stable with supported entity types.
Comment #17
damienmckennaCan someone please test out the current 2.0.x codebase and let me know if you still run into problems? Thank you.
Comment #19
smustgrave commentedSince there's been no follow up to #17 going to close out. If still an issue please re-open. Closing MRs though and updating credit.