Problem/Motivation

When creating an article and node fields are left empty, the current method for comparing the FieldItemList with->equals()
method does not detect that the change can be resolved automatically.

Steps to reproduce

  1. Create a article node(node/1) with user 1
  2. Add title: Lorem
  3. Leave body field empty/untouched
  4. Save node and reopen the edit form for later use
  5. Edit node/1 with user 2
  6. Edit title: Lorem Ipsum
  7. Edit body: Lorem Ipsum
  8. Save node
  9. Activate user 1 node edit form and resave the ”old” node form in step 4.
  10. User 1 should receive a conflict notice with Title and body field, even there is no conflict with body field value as user 1 has not edited the field.

Proposed resolution

Add additional checks to FieldComparatorDefault.php and DefaultConflictDiscovery.php when the local field value is has default value and autoresolve these conflicts.

Issue fork conflict-3447857

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

    Onnia created an issue. See original summary.

    onnia’s picture

    This patch was my first attempt to address the issue.

    onnia’s picture

    Status: Active » Needs review
    kanchan bhogade’s picture

    StatusFileSize
    new296.4 KB

    Hi @Onnia,
    I've tried to reproduce the issue but the site is throwing an error; please let me know if I'm missed something

    Steps to Reproduce:

    1. Created a node(node/1) with user 1
    2. Title: Lorem and body field: empty
    3. Save the node and reopen the edit form for later use
    4. Edit node/1 with user 2
    5. Edit title: Lorem Ipsum, and Edit body: Lorem Ipsum
    6. Save node
    7. Activate user 1 node edit form and resave the ”old” node

    Adding error SS for reference

    onnia’s picture

    Version: 3.0.x-dev » 8.x-2.0-alpha5
    StatusFileSize
    new3.49 KB

    Hi,
    Here is fresh version of the patch against 8.x-2.0-alpha5. I think I had marked the patch against the wrong branch.