Problem/Motivation

We tried to customize the status message makrup in the Claro project. However, we run into some issues because Drupal has quite a few instances where messages markup isn't rendered using the template, but it's instead hard coded.

Proposed resolution

Remove hard coded messages markup and make them use the status-messages template. This way themes can customize the messages markup.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#6 3078400-6.patch12.58 KBandypost
#6 interdiff.txt1.37 KBandypost
#3 3078400-3.patch11.21 KBfinnsky

Issue fork drupal-3078400

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

lauriii created an issue. See original summary.

finnsky’s picture

Assigned: Unassigned » finnsky
finnsky’s picture

Assigned: finnsky » Unassigned
Status: Active » Needs review
StatusFileSize
new11.21 KB

Reworked core js which are use hardcoded messages instead of Drupal.theme.messages

TODO: Define and update php files which should be changed to use status-messages.html.twig

finnsky’s picture

Status: Needs review » Needs work

The last submitted patch, 3: 3078400-3.patch, failed testing. View results

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new1.37 KB
new12.58 KB

Test fails because markup changes for some reason, so I fixed test

Not really sure that needed because this test ensures for render of following markup
<script>var hitsTheFloor = "</body>";</script>
Also \Drupal\render_placeholder_message_test\RenderPlaceholderMessageTestController::setAndLogMessage testing module probably another reason why it may happen

Expected

<script type="application/vnd.drupal-ajax" data-big-pipe-event="stop"></script>


</body></html>

Actual

<script type="application/vnd.drupal-ajax" data-big-pipe-event="stop"></script>


<div id="drupal-live-announce" class="visually-hidden" aria-live="polite" aria-busy="false"></div></body></html>
finnsky’s picture

I think it happened because some messages appear now using regular(not hardcoded) way. And duplicated in announce area. So yeah. This test should be fixed. Thanks @andypost

lauriii’s picture

Status: Needs review » Needs work

This looks like a great start, thank you! We should also remove hard coded messages markup from our PHP code so moving to needs work.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

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

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.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.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.

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

ckrina’s picture

I've just rerolled the previous Drupal 8 patch to Drupal 9 where all the hard coded markup in JS has been removed. The work to remove them from PHP as requested in comment #8 still needs to happen.

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.

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.

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.