Problem/Motivation

Issue with Message in Drupal site

Steps to reproduce

Install Drupal 11
create or edit any node.

close icon

Proposed resolution

Remove extra icon.
Adding a condition to verify that the close button is not present in the message container, then only adding the close button fixes the bug.
if (!messageContainer.querySelector('.messages__button')){}

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3423384

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dineshkumarbollu created an issue. See original summary.

govind_giri_goswami made their first commit to this issue’s fork.

govind_giri_goswami’s picture

Status: Active » Needs review

changes in closeMessage() function, which adds a close button to a message container if one doesn't already exist, and hides the message when the close button is clicked

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update

Would be good to add solution to the issue summary.

Pravesh_Poonia’s picture

Applied MR 6753, Mentioned issue fixed

Tanuj.’s picture

Issue summary: View changes
shreyal999’s picture

The code should have indentation or line gap as in the previous version for code clarity.

Gauravvvv made their first commit to this issue’s fork.

kostyashupenko’s picture

Wondering what is the cause of that fact that once() in that case doesn't actually work (works 2 times)

dineshkumarbollu’s picture

Confirm MR fixes the issue.

adwivedi008’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
23.75 KB

I tested the MR mentioned in #4, and it fixes the issue
So moving the issue to RTBC

nod_ credited andy-blum.

nod_ credited mherchel.

nod_’s picture

when bigpipe is enabled, the status message comes from a bigpipe/ajax command.

The message commands adds a new message using Drupal.theme('message') it calls olivero implementation of the theme function that adds a close button. Nothing is using once at this point. Then when the page loads, behaviors are called, and a second close button is added to the message. Once is working as expected it's just not at the right place.

Theme functions should be returning plain strings instead of objects, that would have prevent the double initialization.

Fix makes sense in this situation.

  • nod_ committed 3f01ed41 on 11.x
    Issue #3423384 by govind_giri_goswami, Gauravvvv, dineshkumarbollu,...

  • nod_ committed bd8960f8 on 10.3.x
    Issue #3423384 by govind_giri_goswami, Gauravvvv, dineshkumarbollu,...

  • nod_ committed 4b60c58b on 10.2.x
    Issue #3423384 by govind_giri_goswami, Gauravvvv, dineshkumarbollu,...

nod_’s picture

Title: Extra Close icon in Messages » Extra Close icon in Olivero Messages
Status: Reviewed & tested by the community » Fixed
Issue tags: -JavaScript +JavaScript

Committed 068b95a and pushed to 11.x. Thanks!

Status: Fixed » Closed (fixed)

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