Publish status and unpublish status field weights reset when schedule settings are editted

Created on 6 June 2023, over 1 year ago
Updated 11 August 2024, 27 days ago

Problem/Motivation

When scheduler settings are editted, the publish_state form widget resets to a weight of 53 and the unpublish_state form widget resets to a weight of 55 on the entity form display.

Steps to reproduce

  • Install and enable scheduler and scheduler content moderation integration.
  • On a content type that has moderation states enabled, save the entity form display with the scheduler fields in the order you desire.
  • Save the entity settings with or without a change to the scheduler fields.
  • Go back to the entity form display and view sort weights.

Proposed resolution

These weights seem to be set as the default in scheduler_content_moderation_integration.module starting around line 409, but unlike Scheduler, it's not checking to see if the value was set as a default and is resetting the hardcoded weights on every save.

To match the code in scheduler, $form_state->getValue('scheduler_publish_enable') needs to be changed to !$form['scheduler']['publish']['scheduler_publish_enable']['#default_value'] so that the widget doesn't reset to the default every time.

πŸ› Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States joshuami Portland, OR

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

Comments & Activities

Production build 0.71.5 2024