Problem/Motivation

This is a bug fix for #2994702: Allow editors to alter embed-specific metadata, as well as `data-align` and `data-caption`

Using EditorMediaDialog to change alignment can leads to double alignment classes on the wrapper. This is due to the fact that the alignment classes are not cleared when the dialog is saved.

double alignment classes

Proposed resolution

Since there are three classes, we need to maintain, we can just clear the classes before adding a new class.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

oknate created an issue. See original summary.

oknate’s picture

Here's the fix, plus a FAIL patch that demonstrates the bug.

oknate’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
62.16 KB
oknate’s picture

The last submitted patch, 2: 3081983-2--FAIL.patch, failed testing. View results

oknate’s picture

Issue summary: View changes
oknate’s picture

Issue tags: +Media Initiative
Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Nice catch, solid test coverage, trivial fix. 👍🚢

effulgentsia’s picture

Crediting @Wim Leers for review.

  • effulgentsia committed 0df5ad9 on 8.8.x
    Issue #3081983 by oknate, Wim Leers: Double Alignment classes on widget...
effulgentsia’s picture

Status: Reviewed & tested by the community » Fixed

Pushed to 8.8.x.

oknate’s picture

Thanks! This was a nice surprise on a Saturday night!

Status: Fixed » Closed (fixed)

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