Skip to content

Tinymce up - #74

Merged
helios-ag merged 12 commits into
masterfrom
tinymce-up
Sep 4, 2026
Merged

Tinymce up#74
helios-ag merged 12 commits into
masterfrom
tinymce-up

Conversation

@helios-ag

Copy link
Copy Markdown
Owner

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25eaa399b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +52 to 55
public function getParent(): string
{
$this->jsPath = $jsPath;
return TextareaType::class;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore the tinymce form block prefix

Without a getBlockPrefix() override, Symfony derives tiny_mce from TinyMCEType, so it searches for tiny_mce_widget; the registered form theme only defines tinymce_widget. Consequently every TinyMCEType falls back to the parent textarea widget and never emits the configuration attributes or runtime script. Restore the previous tinymce prefix or rename the Twig block accordingly.

Useful? React with 👍 / 👎.

Comment thread README.md Outdated
Comment on lines +16 to +17
composer require helios-ag/fm-tinymce-bundle
composer run copy-tinymce-assets

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Register the copy script in consuming projects

After the documented composer require, this bundle is a dependency and its scripts section is not imported into the application's root package, so the next command fails with Script "copy-tinymce-assets" is not defined and no TinyMCE assets are installed. Composer's scripts documentation states that only scripts defined in the root package are executed; the installation instructions must have consumers register the callback in their root composer.json, or expose it through a mechanism available to dependencies.

Useful? React with 👍 / 👎.


unset($options['file_picker_callback'], $options['license_key'], $options['selector']);

$options['base_url'] = $this->packages->getUrl($this->basePath);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Strip asset versions from TinyMCE's base URL

When the application's Symfony asset package uses a query-string version strategy, getUrl($this->basePath) returns a value such as /assets/tinymce?v=2. TinyMCE appends theme, icon, model, and plugin paths to base_url, producing invalid URLs with the query string in the middle of the path; the removed helper explicitly stripped this query component. Keep versioning on the script URL, but normalize base_url to the directory URL before passing it to TinyMCE.

Useful? React with 👍 / 👎.


{% if tiny_mce_inline %}
<textarea {{ block('widget_attributes') }} hidden>{{ value }}</textarea>
<div id="{{ id }}_editor" contenteditable="true" data-fm-tinymce-inline-target="{{ id|e('html_attr') }}" data-fm-tinymce-options="{{ configuration|e('html_attr') }}" data-fm-tinymce-script="{{ script_path|e('html_attr') }}">{{ value }}</div>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Initialize inline content from the hidden value

For an inline profile whose existing value contains HTML, Twig auto-escapes that value inside the editable <div>, so TinyMCE starts with literal text such as <p>text</p> rather than the original paragraph markup. Once the editor changes, the synchronization code serializes those escaped tags back into the hidden textarea and corrupts the stored content. Keep the safe escaped rendering, but seed TinyMCE from the hidden textarea's decoded value during initialization.

Useful? React with 👍 / 👎.

Comment thread src/Resources/public/fm-tinymce.js Outdated
Comment on lines +70 to +72
editor.on('change input', () => {
hiddenTarget.value = editor.getContent();
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Synchronize inline content on form submission

Inline fields update their submitted textarea only for TinyMCE's change and input events. If content is changed through editor.setContent(), a plugin command, or another operation that does not emit either event before an immediate native submission, the hidden textarea retains its previous value and stale data is submitted. Attach a form-submit synchronization hook in addition to these incremental event handlers.

Useful? React with 👍 / 👎.

Comment on lines +110 to +112
if (isset(self::REMOVED_PLUGINS[$plugin])) {
throw new InvalidConfigurationException(sprintf('The "%s" plugin is not available in TinyMCE 8: %s.', $plugin, self::REMOVED_PLUGINS[$plugin]));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject the removed modern theme

When a migrated configuration places theme: modern under options, this validator accepts it and the builder forwards it unchanged, but TinyMCE 8 no longer ships the modern theme; initialization then attempts to load a nonexistent theme and the editor fails. Reject this known legacy value during container compilation just as removed plugins are rejected, matching the upgrade guide's instruction to remove it.

Useful? React with 👍 / 👎.

@helios-ag
helios-ag merged commit 90c2500 into master Sep 4, 2026
2 checks passed
@helios-ag
helios-ag deleted the tinymce-up branch September 4, 2026 07:16
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