Skip to content

fix(pat-tinymce): construct the modal implementation for the link modal - #1622

Open
petschki wants to merge 1 commit into
masterfrom
fix-linkmodal-lazy-modal
Open

fix(pat-tinymce): construct the modal implementation for the link modal#1622
petschki wants to merge 1 commit into
masterfrom
fix-linkmodal-lazy-modal

Conversation

@petschki

Copy link
Copy Markdown
Member

The pat-plone-modal lazification left links.js creating its modal via registry.patterns["plone-modal"].init(...). That static initializer constructs the registered pattern — now the thin registration module, whose methods (show/hide/...) only appear after an async graft — while LinkModal calls this.modal.show() synchronously right after construction. First click on Insert Link/Image threw and the modal stayed broken, which also failed every robot test funneling through it (tinymce, contentbrowser, linkintegrity).

Construct modal--implementation directly instead; mockupParser reproduces the option parsing of the registry path. links.js is only reached via the lazily-loaded tinymce implementation, so the modal body stays out of the eager bundle. Add a regression test asserting the implementation exposes its methods synchronously.

The pat-plone-modal lazification left links.js creating its modal via
registry.patterns["plone-modal"].init(...). That static initializer
constructs the *registered* pattern — now the thin registration module,
whose methods (show/hide/...) only appear after an async graft — while
LinkModal calls this.modal.show() synchronously right after construction.
First click on Insert Link/Image threw and the modal stayed broken, which
also failed every robot test funneling through it (tinymce, contentbrowser,
linkintegrity).

Construct modal--implementation directly instead; mockupParser reproduces
the option parsing of the registry path. links.js is only reached via the
lazily-loaded tinymce implementation, so the modal body stays out of the
eager bundle. Add a regression test asserting the implementation exposes
its methods synchronously.
@petschki
petschki requested a review from MrTango July 20, 2026 10:32
@petschki

Copy link
Copy Markdown
Member Author

/run-coredev-6.3-robottests

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