Hide the "Publish Content" button if there are no changes to publish.

When we don't have anything to publish, the Workspaces module still shows the publish content button. See this screen recording for reference.

Problem/Motivation

Steps to reproduce

Enable the Workspaces module.
...

Proposed resolution

Only show the "Publish content" button when there is something new to be published.

Remaining tasks

Issue Summary update
Add before and after screenshot to the issue summary
Agree on the message
Review
Tests
Commit

User interface changes

Before

screenshot showing the Workspaces "Publish content" button

API changes

Data model changes

Release notes snippet

Issue fork drupal-3218729

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

Gauravmahlawat created an issue. See original summary.

alancunha’s picture

Assigned: Unassigned » alancunha
takuma shimabukuro’s picture

takuma shimabukuro’s picture

Assigned: takuma shimabukuro » Unassigned
Status: Active » Needs review
StatusFileSize
new865 bytes
new222.82 KB

Removed publish operation button when there is nothing to publish

vikashsoni’s picture

Applied patch #5 after patch " Publish Content" button hide if there are no changes to publish
Thanks for the patch
for reference sharing screenshot

takuma shimabukuro’s picture

Status: Needs review » Reviewed & tested by the community

Thanks vikashsoni for reviewing my patch
so i'm moving ticket status for RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 5: 3218729-5.patch, failed testing. View results

beatrizrodrigues’s picture

Since the patch failed, I will check it and try to resolve.

beatrizrodrigues’s picture

Assigned: Unassigned » beatrizrodrigues
gauravvvv’s picture

beatrizrodrigues’s picture

Assigned: beatrizrodrigues » Unassigned
Status: Needs work » Needs review
StatusFileSize
new866 bytes

I tested here and it not return me any errors. I don't know why the failed tests here.

anagomes’s picture

Status: Needs review » Reviewed & tested by the community

As there are no changes in the new patch uploaded and it passes on the tests and fixes the issue, I'm moving it again to RTBC.

amateescu’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs usability review

Are we sure that hiding the Publish the button rather than disabling it is a usability improvement?

beatrizrodrigues’s picture

For me, hiding the publish button does not affect usability at all, as we have a message bellow describing that there are anything to publish. I think there will never be a scenario that that button could be enable in case of nothing to publish, so, why leave it there? Maybe to maintain a pattern. But, again, I don't think this affect usability. But I would like to know another opinion.

benjifisher’s picture

StatusFileSize
new98.94 KB
benjifisher’s picture

StatusFileSize
new100.43 KB
beatrizrodrigues’s picture

So, this issue was brought to UX meeting that happened today. The consent was that the second page should not be displayed as it does not have any usability. The modification should be done at the first page but it was not decided how yet. Please, someone correct me if I am wrong about the conclusions. So, I'll change back to needs works.

beatrizrodrigues’s picture

Status: Needs review » Needs work
benjifisher’s picture

Issue summary: View changes

As @beatrizrodrigues said, we discussed this issue at #3245345: Drupal Usability Meeting 2021-10-29. That issue has a link to a recording of the meeting.

We had pretty strong consensus that a better solution to this problem is not to have the "Publish content" button on the first screen. Instead, have a message explaining that there is nothing available to be published. We did not have time to come up with suggestions, but probably someone familiar with the Workspaces module will have a better idea what to say. Perhaps something like, "All content in the Stage workspace is already published."

During the meeting, I attached a screenshot of the screen recording attached to this issue. Comment #16 was a goof (wrong screenshot) and #17 was the right one. I am rewriting the issue summary using the usual template and adding the screenshot as a "before" image in the "User interface changes" section.

amateescu’s picture

Does that mean we can close this issue? We have #3213208: Do not show the "Publish content" button if user does not have access for changing the 'Publish content' button from the toolbar.

beatrizrodrigues’s picture

@amateescu I think we can close this issue, it is exactly the same of

#3213208: Do not show the "Publish content" button if user does not have access

amateescu’s picture

Status: Needs work » Closed (duplicate)

Ok, closing :)

gauravvvv’s picture

Status: Closed (duplicate) » Needs work
amateescu’s picture

@Gauravmahlawat, the usability team concluded that making it harder to get to this page by removing the Publish button from the toolbar workspace switcher is ok. Please see #18 and #20.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

wagnerarao’s picture

Hi! Let me work on this.

wagnerarao’s picture

Assigned: Unassigned » wagnerarao
wagnerarao’s picture

StatusFileSize
new6.69 KB

Please kindly review this patch. Now the 'Publish Content' is hidden in case there are no content to be published. Instead, it will show a simple text message saying there are no content to be published.

wagnerarao’s picture

Assigned: wagnerarao » Unassigned
wagnerarao’s picture

Status: Needs work » Needs review
alanmoreira’s picture

Assigned: Unassigned » alanmoreira

I'll review this =)

alanmoreira’s picture

Assigned: alanmoreira » Unassigned
Status: Needs review » Reviewed & tested by the community

I applied the patch and all seems to be working fine! Changing status to RTBC =)

amateescu’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Issue tags: -Needs usability review

Closing per #18, #20 and #25.

wagnerarao’s picture

Status: Closed (duplicate) » Reviewed & tested by the community

I was reading the other issue. and i don't think this is a duplicate one. This comment confirms this. It's a different case: https://www.drupal.org/project/drupal/issues/3213208#comment-14132600

quietone’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
Issue tags: +Bug Smash Initiative, +Needs issue summary update, +Novice

There seems to be some disagreement on whether this issue is a duplicate of #3213208: Do not show the "Publish content" button if user does not have access. If I understand the other issue it is only about displaying 'Publish content' when the user has access. This issue is about only displaying 'Publish content' when there are changes to the content. To me, that is different. Also, in #20 a solution is given from the UX review which again supports that this is different.

There is still work to do here. For one what about tests, there are not tests in the patch. The Issue Summary needs to be updated, it needs before and after screen shots, the proposed resolution does not agree with the patch nor the Usability review, and the steps to reproduce are incomplete. I also do no see a code review in the comments.

All the remaining tasks are suitable for a novice, adding tag.

amateescu’s picture

This is indeed about a different button (and page) than the one being addressed in #3213208: Do not show the "Publish content" button if user does not have access, but the UX team's meeting concluded that if we address that one (and users won't be able to get to this page), we don't really have to do anything about this one.

wagnerarao’s picture

@amateescu so this issue can be closed? the task itself is done, i believe.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Yogesh Sahu’s picture

Status: Needs work » Needs review
StatusFileSize
new10.69 KB

Adding the patch for drupal 10.1.x.
no interdiff because #30 patch fail to apply.

skt-001’s picture

Status: Needs review » Needs work
StatusFileSize
new850.9 KB
new1.71 MB

after applying the patch #41 issue still persist so i change the status need work & sharing the SS.

Vinayak.Ambig’s picture

I have applied patch #41 and it's working as expected. Attached video.

Also found one more issue. After clicking publish content in Publish Stage workspace screen if we click cancel button it's redirecting to page not found url. page not found afyter clicking cancel button.mov

gauravvvv’s picture

Attribution updated

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.