Empty fields are not resolved automatically

Created on 17 May 2024, 6 months ago
Updated 7 June 2024, 5 months ago

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.

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇫🇮Finland Onnia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Onnia
  • 🇫🇮Finland Onnia

    This patch was my first attempt to address the issue.

  • Status changed to Needs review 6 months ago
  • 🇮🇳India Kanchan Bhogade

    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

  • 🇫🇮Finland Onnia

    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.

Production build 0.71.5 2024