Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#51 implement HOOK_ckeditor5_entity_browser_definitions_alter #52

Merged
merged 2 commits into from
May 13, 2024

Conversation

RobinHoutevelts
Copy link
Contributor

Description

In #49 we've decided to no longer maintain a custom ckeditor javascript plugin.
Instead we rely on drupal/ckeditor5_entity_browser to show the file entity browser dialog modal.

drupal/ckeditor5_entity_browser opens a dialog by calling /entity-browser/modal/file_editor.
That route doesn't exist because our file_editor entity browser is configured to be an iframe, not a modal.
That's being fixed upstream in #3445512, but that's still a problem for us.

We have a custom wmmedia.file.browser.editor route intended to be called by the ckeditor dialog.
This route isn't being used at all anymore and is causing issues.

For example, the "Upload" tab isn't being rendered anymore.
And when you search, you're being sent to a different web page because the modal isn't rendering an iframe.

Steps to reproduce

Configure ckeditor5_entity_browser to show the file_editor entity browser.
Add a file link by triggering the entity browser modal, and search for a string.
You'll notice you're leaving the ckeditor context.

Video
Edit.Text.from.T.Test.page.UZ.Leuven.-.6.May.2024.mp4

Expected result

Our wmmedia.file.browser.editor route should be rendered.
It attaches the correct libraries to use the entity browser in a modal.

To alter the dialog that's opened by ckeditor5_entity_browser.
It will now open our wmmedia.file.browser.editor route.
@RobinHoutevelts
Copy link
Contributor Author

RobinHoutevelts commented May 6, 2024

This requires https://www.drupal.org/project/ckeditor5_entity_browser/issues/3445512 to have been fixed.
You can use this patch url:

https://git.drupalcode.org/project/ckeditor5_entity_browser/-/commit/b96a24663f4b1baa67d12a20b00f7ddb7f92f4a9.patch

Edit: Upstream issue has been merged. Still waiting for a new version to be made.
Perhaps we should add a composer conflict for "drupal/ckeditor5_entity_browser": "<1.0.2"

That way, anybody that installs wmmedia, knows they need to install at least ckeditor5_entity_browser: 1.0.2 to have this functionality working.

@RobinHoutevelts
Copy link
Contributor Author

Upstream issue is merged, so we can merge this one too.

@RobinHoutevelts RobinHoutevelts merged commit a1f38d9 into main May 13, 2024
@RobinHoutevelts RobinHoutevelts deleted the 51-override-ckeditor5-dialog-route branch May 13, 2024 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant