Problem/Motivation
When creating a custom message for the maintenance page, you can use HTML at /admin/config/development/maintenance. The purpose of this issue is to enable the WYSIWYG editor on this page.
User interface changes
Before:
Expected after:
Impacts
- Update the system.schema and the corresponding system.maintenace configuration.
- Add hook_update_N() for this.
- Update MaintenanceForm to allow WYSIWYG.
- Update the message display in Maintenance page to let the message value being displayed.
- Update tests
- Update translation tests
- Update update process (from D6/D7 to D8)
- Update the update process tests.
Data model changes
Before message is now a text_format instead of text in system.schema.yml, the system.maintenance.yml is impacted. message key is now an array of value / format.
Before:
message: '@site is currently under maintenance. We should be back shortly. Thank you for your patience.'
langcode: enAfter:
message:
value: '@site is currently under maintenance. We should be back shortly. Thank you for your patience.'
format: plain_text
langcode: en
| Comment | File | Size | Author |
|---|---|---|---|
| #59 | system-maintenance-message-text-format-d11.patch | 3.57 KB | simbaw |
| #57 | 2747749-56.patch | 11.22 KB | yuehua |
| #55 | 2747749-55.patch | 10.51 KB | _utsavsharma |
| #55 | interdiff_54-55.txt | 1.59 KB | _utsavsharma |
| #54 | 2747749-wysiwyg-maintenance-page-10.1x_53.patch | 10.53 KB | jessey |
Comments
Comment #2
dom. commentedHere is a first draft of a patch. To be honest, I expect it to fail on tests, but it will help to isolate the various impacts described in the issue description.
Comment #3
cilefen commentedComment #5
dom. commentedSorry, forgot a dsm() instruction. Rerolling.
Comment #7
dom. commentedComment #17
Williamp@ciandt.com commentedComment #18
Williamp@ciandt.com commentedComment #19
huberyl commentedComment #20
avpadernoComment #21
avpadernoComment #23
nikitagupta commentedReroll the patch againts #7.
Comment #24
avpadernoComment #25
anmolgoyal74 commentedFixed syntax error in #22.
Comment #28
bbombachiniI needed this patch for 8.9x so I've just rerolled the patch and I've updated schema that was missing.
Comment #29
bbombachiniComment #30
anweshasinha commentedI am working on it
Comment #31
anweshasinha commentedHi,
Please review and test my patch.
Comment #32
avpadernoThe last item in an array needs a comma at the end, like the other items.
Comment #33
swatichouhan012 commentedAdded fixes of #32 and created new patch, please review
Comment #35
avpadernoThe tests are falling because this warning.
Since the configuration has been changed, the schema for that configuration needs to be changed as well.
Comment #36
avpadernoIn this case, the part to change is the following one, in system.schema.yml.
I didn't find documentation for the values to assign to type. I cannot say which one is correct for a value that is changed using a text_area form element.
Comment #37
ankithashettyTried fixing test errors in #33.
@apaderno, thank you for the hint. Came across this doc => https://api.drupal.org/api/drupal/core%21config%21schema%21core.data_types.schema.yml/8.2.x , which redirected me to https://git.drupalcode.org/project/drupal/blob/8.0.x/core/config/schema/core.data_types.schema.yml#L750 line. Hopefully this should fix.
Thank you!
Comment #38
bbombachiniAlthough the patch worked, the content rendered wasn't being processed by ckeditor, so entities weren't being replaced, etc.
I had to preprocess the content and run it through the text format, like:
Comment #40
bbombachiniAfter updating the site to 9.2.7 and using the patch from #37 I started getting an error and my changes wouldn't save anymore.
I don't know what happened between patch #28 and #31 but they are drastically different.
I'll do a reroll of #28 and apply the suggestions from @apaderno
Comment #41
bbombachiniOk, original patch from #25 re-rolled for 9.2x and 9.3x
Please review.
Comment #43
aaronchristian commentedPatch for 9.4.x
Comment #45
thejimbirch commentedThe patch in #41 for 9.3.x worked for me. Remember to run
drush updbor hitupdate.phpbefore you save your message.Will be back soon to try the patch in #43 for 9.4.x
Thanks!
Comment #46
aaronchristian commentedThanks Jim, yep looks like its some tests that are failing!
Comment #47
bbombachiniComment #48
avpadernoAren't the tests already implemented? The patch is changing core/modules/config/tests/src/Functional/ConfigExportUITest.php, which seem a test class for this change.
Comment #50
earthday47(not ignoring the tests question, but)
Needed to reroll the patch for Drupal 9.5.0, see attached.
Comment #52
jessey commentedComment #53
zeeshan_khan commentedComment #54
jessey commentedComment #55
_utsavsharma commentedFixed failures in #54.
Comment #57
yuehua commentedReroll the patch for Drupal 10.2.3.
Comment #59
simbaw commentedsupport 11.3.5
Comment #60
simbaw commentedComment #61
smustgrave commented+1 for this feature!
But fixes need to be in MRs for review and have to land in main branch first and could be backported. Though as a feature probably not in 11.3
Thanks!