Problem/Motivation

Save as published is not working as designed

Steps to reproduce

  • Clone an entity
  • Set save entity as published to true
  • Save cloned entity
  • Cloned entity takes default moderation state not published

Proposed resolution

After I checked the module set status of the cloned entity to 1 without also making sure moderation state is set to published based on the save as published checkbox so we need to do that.

Note: for me it checks for moderation state in $properties['moderation_state'] but there is no moderation state there it also doesn't take the save as published result in consideration.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ibrahim tameme created an issue. See original summary.

kiseleva.t’s picture

StatusFileSize
new1.04 KB

Exported MR into patch.

hrgadev’s picture

Updated patch with MR changes for moderation_state handling.

hrgadev’s picture

Assigned: Unassigned » hrgadev
StatusFileSize
new1.08 KB

Exported MR into patch.

deaom’s picture

Assigned: hrgadev » Unassigned
Status: Active » Needs review

Setting status to needs review, did test it and can confirm the issue is present if using content moderation module. The MR solves the issue by forcing the status to publish in case the checkbox is checked. If checkbox is not checked the status is copied from original entity.
The failing tests are due to the action UI module no longer being present in core (from D10.3) and maintainers need to decide if they want to add contributed module dependency or remove action from testing.

deaom’s picture

Branch is re-based and tests are passing. Not sure if any additional test are needed/required so leaving status to needs review.

rajeshreeputra’s picture

Status: Needs review » Reviewed & tested by the community

looks good, added to merge train.

n.ghunaim’s picture

StatusFileSize
new3.34 KB

Exported MR into patch.

rajeshreeputra’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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