Active not updated when alert is translated.

Created on 11 September 2023, 10 months ago

Problem/Motivation

When user allow sitewide alerts to be translatable and then create one content and translate it, the entity does not update the Active (status) so it keeps always the same value and for example cannot be disable never.

Steps to reproduce

  1. Set up sitewide alert entity to be translatable
  2. create an alert
  3. Edit the alert and change Active value and save it
  4. Check the alert display the correct Active value
  5. Translate the alert
  6. Edit the alert and change Active value and save it
  7. Check the Active value has the wrong value

Proposed resolution

After review Entity definition (annotation and class SitewideAlert) I didn't found anything wrong.
I think the solution could it be set entity value in SitewideAlertForm::save method doing something like

// Set status value.
    $entity->set('status', $form_state->getValue('status'));

but that's a workaround because the problem only happen when translation is enable so there should be something else.

πŸ› Bug report
Status

Needs review

Version

2.1

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain fran seva

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

Comments & Activities

Production build 0.69.0 2024