Problem/Motivation

Reordering a multi valued block field seems to save the wrong block config for items that are moved. See screens.

Before moving:
Before moving

After moving:
After moving

After saving:
After saving

Note that after saving, the labels and Display title config has been swapped between the Standards mode and Standards discipline blocks.

Proposed resolution

Fix it!

Remaining tasks

Fix, test.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acbramley created an issue. See original summary.

acbramley’s picture

Assigned: Unassigned » acbramley

Taking a look at this now.

acbramley’s picture

Assigned: acbramley » Unassigned
fenstrat’s picture

Title: Reordering multi valued block fields seems to mix up block config for moved items once entity is saved » Reordering multi valued block fields mixes up block id and settings for moved items once entity is saved
Assigned: Unassigned » fenstrat
Status: Active » Needs review
FileSize
1.34 KB
2.34 KB

Tricky little bug this! Tracked it back to the delta being used to save the widget settings (plugin/block id is being saved correctly, it's just the settings that are getting mixed up). Thankfully WidgetBase::extractFormValues() provides us with an _original_delta value which can be used to get the correct settings.

Attached patch fixes this, test-only should fail to demonstrate the issue.

The last submitted patch, 4: 2925436-4-test-only.patch, failed testing. View results

acbramley’s picture

Status: Needs review » Reviewed & tested by the community

Very nice! Looks good to me!

  • fenstrat committed d581010 on 8.x-1.x
    Issue #2925436 by fenstrat, acbramley: Reordering multi valued block...
fenstrat’s picture

Assigned: fenstrat » Unassigned
Status: Reviewed & tested by the community » Fixed

Cheers!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.