πŸ‡¦πŸ‡«Afghanistan @alpha2zee

Account created on 4 November 2007, over 16 years ago
#

Recent comments

πŸ‡¦πŸ‡«Afghanistan alpha2zee

Minor info.yml change incorporated in new module version 4.1.4

πŸ‡¦πŸ‡«Afghanistan alpha2zee

Thanks for correcting me. I was under the wrong impression, or may be I had tested a D10 version with a fix πŸ› TypeError: Drupal\ckeditor5\HTMLRestrictions::__construct(): Argument #1 ($elements) must be of type array, Drupal\ckeditor5\HTMLRestrictions given Needs work . The issue does occur in current and dev releases of D10. In my opinion, it is still primarily a core/CKEditor issue with handling of filter modules, as discussed elsewhere πŸ› TypeError: Drupal\ckeditor5\HTMLRestrictions::__construct(): Argument #1 ($elements) must be of type array, Drupal\ckeditor5\HTMLRestrictions given Needs work .

I cannot change the module filter type to something other than TYPE_HTML_RESTRICTOR.

As you noted, implementing getHTMLRestrictions in the htmLawed module is difficult because htmLawed has a different filtering customization and may be more complex filtering ability than Drupal/CKEditor (e.g., regex patterns to indicate permissibility of attribute values). Correctly conveying this through getHTMLRestrictions() may not be not possible .

πŸ‡¦πŸ‡«Afghanistan alpha2zee

As noted elsewhere πŸ› TypeError: Argument 1 passed to Drupal\ckeditor5\HTMLRestrictions::__construct() must be of the type array, object given Closed: works as designed , the CKEditor5 issue doesn't occur in D10 but occurs in D9. It seems CKEditor5 devs are trying πŸ› TypeError: Drupal\ckeditor5\HTMLRestrictions::__construct(): Argument #1 ($elements) must be of type array, Drupal\ckeditor5\HTMLRestrictions given Needs work to get a fix for D9. I guess we just have to wait for that. For those who need an immediate fix, perhaps the suggested patch will work well.

πŸ‡¦πŸ‡«Afghanistan alpha2zee

Thank you for looking into the issue to identify its cause and also note possible fixes along with their drawbacks.

htmLawed is functionally TYPE_HTML_RESTRICTOR, and while making it TYPE_TRANSFORM_IRREVERSIBLE will fix this CKEditor issue, I don't know what issues will arise from the change.

I think it is better to open an issue with CKEditor devs to change their code logic.

πŸ‡¦πŸ‡«Afghanistan alpha2zee

Thanks for reporting this issue. I can confirm that it occurs with both an old and freshly installed Drupal 9.5+ installation. Such issue doesn't occur with another Drupal text filter module that I tested (Twigs). In my setup, the message I see is:

Error message
The current CKEditor 5 build requires the following elements and attributes:
<br> <p> <h2> <h3> <h4> <h5> <h6> <strong> <em>
The following elements are missing:
<br> <p> <h2> <h3> <h4> <h5> <h6> <strong> <em>

The issue doesn't occur in Drupal 10 (htmLawed module code same as Drupal 9), making me wonder if the issue is in Drupal 9 or its CKEditor code.

πŸ‡¦πŸ‡«Afghanistan alpha2zee

OK. So, after removing 'style' from 'deny_attribute', you are still not able to use CKEditor's style. But, without using CKEditor, can you input HTML text with 'style'? E.g., some text like <span style='color: black'>test</span>. Can you check? What I am saying is: Is the issue in CKEditor and not htmLawed?

πŸ‡¦πŸ‡«Afghanistan alpha2zee

Try removing 'style' from the 'deny_attribute' parameter of htmLawed setting.

πŸ‡¦πŸ‡«Afghanistan alpha2zee

The htmLawed module's default setting is to use htmLawed in 'safe' mode (see documentation β†’ ). This prevents use of the 'style' attribute. Perhaps this is the cause of the issue.

Production build 0.69.0 2024