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

[5.0] tinyMCE b/c fixes #40626

Merged
merged 30 commits into from
May 29, 2023
Merged

Conversation

dgrammatiko
Copy link
Contributor

@dgrammatiko dgrammatiko commented May 19, 2023

Pull Request for Issue #40622

Summary of Changes

  • @richard67 added a function to transform some J3/4 parameters to their new expected values for tinyMCE v6
  • Replaced the same values in the installation SQL files
  • Removed the template plugin as it's deprecated
  • Introduce a fork of the template plugin, named jtemplate
  • Patch both the builder for the above change
  • Introduce a function onAjaxTinymce(), so that templates will be fetched on request rather than on the rendering of the editor (security + perf)
  • Removed/renamed plugins and options to satisfy the changes of tinyMCE v6

Testing Instructions

  1. d/l and install a fresh copy of Joomla from the GH PR. Check that tinyMCE works as expected, particularly check the templates functionality.

  2. Have a J4 installation and create some more TinyMCE Sets. Try to use all the buttons,menus,etc, and also have some html (or txt) files as templates in the cassiopeia/html/tinymce. UPGRADE to J5 using the Custom URL in the administrator/index.php?option=com_config&view=component&component=com_joomlaupdate&path= with a vaule https://ci.joomla.org/artifacts/joomla/joomla-cms/5.0-dev/40626/downloads/65966/pr_list.xml. Enure that the configuarations are identical and that the templates are still working.

Actual result BEFORE applying this Pull Request

Broken Upgrade

Expected result AFTER applying this Pull Request

No breaks

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@brianteeman @HLeithner @laoneo

@brianteeman
Copy link
Contributor

\plugins\editors\tinymce\src\PluginTraits\DisplayTrait.php

$scriptOptions['forced_root_block'] = '';

forced_root_block must be a non-empty string and cannot take a value of false.

@dgrammatiko
Copy link
Contributor Author

forced_root_block must be a non-empty string and cannot take a value of false.

So what should it be?

@brianteeman
Copy link
Contributor

no idea

@brianteeman
Copy link
Contributor

@brianteeman
Copy link
Contributor

            'paste'        => ['label' => 'Paste', 'plugin' => 'paste'],
            'pastetext'    => ['label' => 'Paste as text', 'plugin' => 'paste'],

https://www.tiny.cloud/docs/tinymce/6/6.0-release-notes-core-changes/#changed-plugins-paste

@brianteeman
Copy link
Contributor

        'emoticons'      => ['label' => 'Emoticons', 'plugin' => 'emoticons'],

https://www.tiny.cloud/docs/tinymce/6/6.0-release-notes-core-changes/#new-and-improved-plugins-emoticons

Check but i think that means the label is now "Emoji"

@dgrammatiko
Copy link
Contributor Author

dgrammatiko commented May 19, 2023

emoticons

This still exists in the plugin folder

@brianteeman you can ignore this as the name is correct:
Screenshot 2023-05-19 at 23 49 52

@brianteeman
Copy link
Contributor

brianteeman commented May 19, 2023

To Check

  • Do we still need any of the language strings PLG_TINY_TOOLBAR_BUTTON_ etc
  • Button Seperator not displayed
  • Editor has rounded corners
  • Emoji/Emoticons
  • Text patterns
  • Forced root block - think this was something @crystalenka added

@dgrammatiko
Copy link
Contributor Author

Button Seperator not displayed

That's a visual difference for v6 (there's no separation bar anymore)

@joomla-cms-bot joomla-cms-bot added the NPM Resource Changed This Pull Request can't be tested by Patchtester label May 21, 2023
@dgrammatiko dgrammatiko force-pushed the 5.0-dev-tiny-fixes branch 2 times, most recently from b2991b0 to 0024f68 Compare May 21, 2023 12:48
- rename it to jtemplate
- rework the way templates work (now it's ajax based)
@richard67
Copy link
Member

@dgrammatiko I've allowed myself to update your branch for this PR to the latest 5.0-dev with the results of the upmerge so that we get a usable update package built by Drone for this PR, and so people can use that for testing the migration. Before that, updating from 4.4 to 5 was broken due to the missing upmerge.

@dgrammatiko
Copy link
Contributor Author

I will update the description, testing instructions, etc, later on or tomorrow

@richard67 richard67 added the bug label May 21, 2023
@brianteeman
Copy link
Contributor

Button Seperator not displayed

That's a visual difference for v6 (there's no separation bar anymore)

The problem then is that the visual seperator is still shown in the plugin configuration

@brianteeman
Copy link
Contributor

Can you please update the licence in the tinymce.xml as it is no longer LGPL but is instead MIT

@brianteeman
Copy link
Contributor

source code plugin (highlighter) fails with

```

plugin-es5.min.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'codemirror')
at Object.t [as onAction] (plugin-es5.min.js:1:153)
at theme.min.js:4:283552
at theme.min.js:4:123218
at theme.min.js:4:283521
at theme.min.js:4:30451
at L (theme.min.js:4:2411)
at run (theme.min.js:4:30436)
at theme.min.js:4:31303
at theme.min.js:4:795
at theme.min.js:4:152163

@dgrammatiko
Copy link
Contributor Author

source code plugin (highlighter) fails with

I've seen it as well, but let's leave this for another PR (it needs also the Codemirror v5 upgrade). I mean patching the plugin for the existing code mirror would be wasted energy as the editor needs an upgrade...

HLeithner and others added 2 commits May 27, 2023 10:58
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@HLeithner HLeithner merged commit 25ef885 into joomla:5.0-dev May 29, 2023
@HLeithner
Copy link
Member

thanks, can you please create a pr for the issue mentioned by brian?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.0-dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants