Problem/Motivation

The Email HTML format has the default weight which is 0.
As other formats has the same default weight, the Email HTML format became the first default format for all text fields in our websites after installing this module. Since this format is used for email relevant text field, for the most of scenarios, we don't need this format, so that we have to change the text format every time we create or edit a content entity.

Change format

Proposed resolution

Downgrade the weight of Email HTML format to 10, which is the same as the Plain text format created by the core.
See https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/fil...

CommentFileSizeAuthor
#2 Text format select.png60.06 KBmingsong
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

Mingsong created an issue. See original summary.

mingsong’s picture

StatusFileSize
new60.06 KB
mingsong’s picture

Issue summary: View changes

mingsong’s picture

Status: Active » Needs review
adamps’s picture

Status: Needs review » Needs work

Good idea.

1) You need to change filter.format.email_html.yml 😃
2) I suggest we delete the update hook. If a site doesn't like the default weight probably they already fixed it to what they want - not necessarily to 10. Or maybe they even deleted "Email HTML" already and use something else.

mingsong’s picture

Thanks @Adam,

I updated the weight in filter.format.email_html.yml as suggested.

Regarding the update hook. Since we have already had many websites conducted the 10002 update, which means in their database, the latest update hook number for this module is 10002. If we delete the hook, that might introduce a data integrity issue. In other words, the next update number should be 10003. For this reason, we'd better leave the 10002 as it is but changing the weight to 10 instead.

mingsong’s picture

Status: Needs work » Needs review
adamps’s picture

Status: Needs review » Fixed

Regarding the update hook.

Yes you are right.

  • AdamPS committed 2e91b1c6 on 1.x authored by Mingsong
    Issue #3383917 by Mingsong, AdamPS: Downgrade the weight of Email HTML...

Status: Fixed » Closed (fixed)

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