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

Command icon 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:

Comments

aaron.ferris created an issue. See original summary.

aaron.ferris’s picture

Issue summary: View changes
aaron.ferris’s picture

Issue summary: View changes
aaron.ferris’s picture

Title: Replacing on a paragraph doesn't seem to create a new node revision » Replacing on a paragraph doesn't seem include the new revision in the revisions table
Issue summary: View changes
aaron.ferris’s picture

Title: Replacing on a paragraph doesn't seem include the new revision in the revisions table » Replacing on a paragraph doesn't seem to include the new revision in the revisions table
aaron.ferris’s picture

Issue summary: View changes
aaron.ferris’s picture

From 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()

MariaDB [db]> select * from node_field_revision where vid=25;
+-----+-----+----------+--------+-----+----------------------------+------------+------------+---------+--------+------------------+-------------------------------+
| nid | vid | langcode | status | uid | title                      | created    | changed    | promote | sticky | default_langcode | revision_translation_affected |
+-----+-----+----------+--------+-----+----------------------------+------------+------------+---------+--------+------------------+-------------------------------+
|   5 |  25 | en       |      1 |   1 | Test | 1706878729 | 1706880802 |       0 |      0 |                1 |                          NULL |
nicholass’s picture

simeonkesmev made their first commit to this issue’s fork.

simeonkesmev’s picture

Added 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.

joseph.olstad’s picture

Nice work on the branch see comments below.

For anyone wanting to test it, here's the patch
https://git.drupalcode.org/project/scanner/-/merge_requests/29.patch

joseph.olstad’s picture

Hmm, ya, the merge request removes language support which is definately likely going to break things however please do continue as perhaps language support can be re-added after this is nailed down solid.

smustgrave’s picture

Version: 8.x-1.0-rc7 » 2.0.x-dev

Can we update for 2.0.x please.

damienmckenna’s picture

Status: Active » Needs work
Issue tags: +Needs tests
damienmckenna’s picture

Trying to make 2.0.0 very stable with supported entity types.

damienmckenna’s picture

Status: Needs work » Postponed (maintainer needs more info)

Can someone please test out the current 2.0.x codebase and let me know if you still run into problems? Thank you.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Since 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.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.