Problem/Motivation

ckeditor5_module_implements_alter() is a very complex workaround due to its hook needing to account for two different other hooks that are actually different hooks but called at the same time due to ModuleHandler::alter()'s capability to invoke multiple alter hooks at once.

Steps to reproduce

Proposed resolution

I think it simplifies things if we let Media check for ckeditor5 now, both are now stable modules, there isn't really any preference in either direction. And the logic is easier to understand if media conditionally adds the validation instead of adding it and then ckeditor5 removes it again.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3505641

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

berdir created an issue. See original summary.

berdir’s picture

Status: Active » Needs review

media module does now rely on the implicit default hook order based on module name. It also is completely unclear to me why we implement this twice instead of using the base form id like editor and ckeditor5, but wasn't sure about the scope here.

nicxvan’s picture

I'd like to request this be postponed on #3485896: Hook ordering across OOP, procedural and with extra types i.e replace hook_module_implements_alter

We are currently using that in examples and it's the only implementation of that grouping in core.

We do have test coverage for it, but removing all of the examples and changing how hmia works before will make that issue harder to understand this part of the implementation.

It will also be a lot easier to incorporate this issue after #3485896: Hook ordering across OOP, procedural and with extra types i.e replace hook_module_implements_alter vs rebasing #3485896: Hook ordering across OOP, procedural and with extra types i.e replace hook_module_implements_alter on top of this change.

smustgrave’s picture

Status: Needs review » Postponed

If no objections to #4

berdir’s picture

Status: Postponed » Needs review

Rebased, obviously conflicted heavily, still a useful simplification.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Looks like a good clean up to me!

nod_’s picture

Status: Reviewed & tested by the community » Needs work

+1 to the simplification but it seems like we're loosing some informations as to why it's not necessary when using ckeditor. Can we get more of the comment ported to media in addition to the logic?

berdir’s picture

Component: ckeditor5.module » media system
Status: Needs work » Needs review

Extended the comment a bit. Feels a bit redundant to add it twice, but also overkill to refer from one to the other.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Feedback for a comment appears to be addressed

  • nod_ committed c4340b27 on 11.3.x
    Issue #3505641 by berdir, smustgrave: Simplify...
nod_’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed f7e7f3efe42 to 11.x and c4340b27c61 to 11.3.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • nod_ committed f7e7f3ef on 11.x
    Issue #3505641 by berdir, smustgrave: Simplify...

Status: Fixed » Closed (fixed)

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