Problem/Motivation

Add validation for HTML restrictor filters that only set forbidden_tags in Drupal\ckeditor5\Plugin\Validation\Constraint\FundamentalCompatibilityConstraintValidator.

Because of #3272516: Deprecate FilterInterface::getHTMLRestrictions()' forbidden_tags functionality, the CKEditor 5 module does not need to be able to handle the "forbidden tags" functionality that filters would've been able to use in Drupal 8 and 9.

Steps to reproduce

N/A

Proposed resolution

Remove the related @todos, detection logic and exceptions in Drupal 10 (since the "forbidden tags" functionality was deprecated in 9.4 and removed in 10).

Remaining tasks

User interface changes

API changes

Data model changes

Comments

lauriii created an issue. See original summary.

wim leers’s picture

Title: Add validation for HTML restrictor filters that only set forbidden_tags » [PP-1] Add validation for HTML restrictor filters that only set forbidden_tags
Project: CKEditor 5 » Drupal core
Version: 1.0.x-dev » 9.3.x-dev
Component: Code » ckeditor5.module
Status: Active » Postponed
Related issues: +#3228334: Refactor HTMLRestrictionsUtilities to a HtmlRestrictions value object

This should wait for #3228334: Refactor HTMLRestrictionsUtilities to a HtmlRestrictions value object to finish; that will make this simpler.

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.

wim leers’s picture

Title: [PP-1] Add validation for HTML restrictor filters that only set forbidden_tags » Add validation for HTML restrictor filters that only set forbidden_tags
Status: Postponed » Needs review
StatusFileSize
new2.06 KB

#3228334: Refactor HTMLRestrictionsUtilities to a HtmlRestrictions value object is in!

This issue will have to remove these two @todos. Let's see what fails.

Status: Needs review » Needs work

The last submitted patch, 4: 3231336-4.patch, failed testing. View results

wim leers’s picture

Title: Add validation for HTML restrictor filters that only set forbidden_tags » [PP-1] Add validation for HTML restrictor filters that only set forbidden_tags
Status: Needs work » Postponed
Related issues: +#3272516: Deprecate FilterInterface::getHTMLRestrictions()' forbidden_tags functionality

Postponed on decision in #3272516: Deprecate FilterInterface::getHTMLRestrictions()' forbidden_tags functionality, potentially this will be a Closed (won't fix).

It also means that this is definitely not a stable blocker, per @catch's input at #3272516. So will remove this from #3238333: Roadmap to CKEditor 5 stable in Drupal 9.

wim leers’s picture

Title: [PP-1] Add validation for HTML restrictor filters that only set forbidden_tags » Add validation for HTML restrictor filters that only set forbidden_tags
Status: Postponed » Closed (outdated)
wim leers’s picture

Title: Add validation for HTML restrictor filters that only set forbidden_tags » Simplify HtmlRestrictions and FundamentalCompatibilityConstraintValidator now that "forbidden tags" are deprecated
Version: 9.4.x-dev » 10.0.x-dev
Issue summary: View changes
Status: Closed (outdated) » Needs review
Issue tags: -Needs issue summary update
StatusFileSize
new2.79 KB
new7.19 KB
new1.21 KB

Was pointed here from #3280343: Audit of CKEditor 5 @todo items, realized that while we didn't need to implement this anymore thanks to #3272516: Deprecate FilterInterface::getHTMLRestrictions()' forbidden_tags functionality, we should still remove all @todos and detection logic!

The tricky thing is that #3272516: Deprecate FilterInterface::getHTMLRestrictions()' forbidden_tags functionality actually already removed most of this (but not all of it) in the 10.0.x branch. Which means that we need different patches for 9.5.x and 10.0.x.

OTOH, it's only deprecated in 9.5.x, so … does it really make sense to remove there? I think we should commit only the 10.0.x patch.

P.S.: Unfortunately there's also a bit of inconsistency in these files between 9.5.x and 10.0.x in HEAD … exactly because some of this was committed only to 10 and not 9. The after-applying-patches-diff-between-95-and-100.diff file shows the full set of differences, which proves that this makes everything consistent again. Reproduce that diff locally by doing git diff 9.5.x 10.0.x -- core/modules/ckeditor5/src after committing both patches locally.

lauriii’s picture

Status: Needs review » Needs work

There's still a mention of forbidden tags in 9.5.x \Drupal\ckeditor5\HTMLRestrictions docblock which I believe should be removed.

wim leers’s picture

Issue tags: +Novice

I’ll tackle that tomorrow morning, unless somebody else gets to it before then!

wim leers’s picture

Status: Needs work » Needs review
Issue tags: -Novice
StatusFileSize
new618 bytes
new7.46 KB
new2.79 KB

#10 Ugh that wasn't around when I created after-applying-patches-diff-between-95-and-100.diff — I must've uploaded an old version of the D9 patch :/

The D10 patch here is effectively identical to that in #9.

Now what I wrote about git diff 9.5.x 10.0.x -- core/modules/ckeditor5/src should be true 😊😅

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

Thank you! Looks good to me now.

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work

There's a leftover @todo pointing to this issue that should get addressed in both patches:
\Drupal\ckeditor5\HTMLRestrictions::unrestricted

    // @todo Refine in https://www.drupal.org/project/drupal/issues/3231336, including adding support for all operations.

wim leers’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new791 bytes
new7.9 KB
new3.23 KB

Thanks for catching that! 👍

  • bnjmnm committed 5a24020 on 10.1.x
    Issue #3231336 by Wim Leers, lauriii: Simplify HtmlRestrictions and...

  • bnjmnm committed a4fbbb4 on 10.0.x
    Issue #3231336 by Wim Leers, lauriii: Simplify HtmlRestrictions and...

  • bnjmnm committed 099d151 on 9.5.x
    Issue #3231336 by Wim Leers, lauriii: Simplify HtmlRestrictions and...
bnjmnm’s picture

Status: Reviewed & tested by the community » Fixed

Excellent. Committed to 10.1.x which got cherry picked to 10.0.x, and 9.5.x got its own commit.

Status: Fixed » Closed (fixed)

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

wim leers’s picture

Version: 10.0.x-dev » 9.4.x-dev
Status: Closed (fixed) » Patch (to be ported)

The fix should still be backported to 9.4.x.

Will provide a patch. Currently not cleanly cherry-pickable. So determining what the optimal cherry-pick order is …

wim leers’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

#15 still applies cleanly to 9.4.x too! Test queued 👍

  • catch committed b8c4044 on 9.4.x
    Issue #3231336 by Wim Leers, lauriii, bnjmnm: Simplify HtmlRestrictions...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Agreed this looks fine for backport. Committed/pushed to 9.4.x, thanks!

wim leers’s picture

Version: 9.4.x-dev » 10.0.x-dev
Status: Fixed » Closed (fixed)

Restoring previous status.