Skip to content

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

Merged
petschki merged 1 commit into
masterfrom
fix-linkmodal-lazy-modal
Sep 9, 2026
Merged

fix(pat-tinymce): construct the modal implementation for the link modal#1622
petschki merged 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.

@petschki
petschki requested a review from MrTango July 20, 2026 10:32
@petschki

Copy link
Copy Markdown
Member Author

/run-coredev-6.3-robottests

@thet
thet force-pushed the fix-linkmodal-lazy-modal branch from b50b2f0 to db87c58 Compare August 3, 2026 03:44
@petschki
petschki force-pushed the fix-linkmodal-lazy-modal branch from db87c58 to c7c2920 Compare September 9, 2026 10:34
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 force-pushed the fix-linkmodal-lazy-modal branch from c7c2920 to e72149a Compare September 9, 2026 12:09
@petschki

petschki commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

/run-coredev-6.3-robottests

@petschki
petschki requested a review from thet September 9, 2026 14:26
@petschki
petschki merged commit aa821b9 into master Sep 9, 2026
4 checks passed
@petschki
petschki deleted the fix-linkmodal-lazy-modal branch September 9, 2026 15:14
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