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

Install TinyMCE 7.5 via composer #4113

Merged
merged 70 commits into from
Dec 9, 2024
Merged

Install TinyMCE 7.5 via composer #4113

merged 70 commits into from
Dec 9, 2024

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Jul 24, 2024

Description (*)

I've updated the copy-plugin to work if you install OpenMage as composer dependency.

Related Pull Requests

Update

  • moved block classes from Adminhtml/Cms to Cms/Adminhtml (and deprecated old ones)

Todo

  • for another PR ... add another config option to always use editor
  • for another PR ... disable editor if TinyMce is not installed

sreichel added 6 commits July 22, 2024 14:01
* Rector: CQ - UnusedForeachValueToArrayKeysRector

See Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector

* fixes + phpstan

See fix at rector: rectorphp/rector-src#6164
@github-actions github-actions bot added composer Relates to composer.json JavaScript Relates to js/* labels Jul 24, 2024
@sreichel sreichel changed the title Install TinyMCE to 6.x via composer Install TinyMCE 6.x via composer Jul 24, 2024
@addison74
Copy link
Contributor

Very good idea, but @fballiano, @empiricompany and I worked on a custom version for TinyMCE which is now available in version 20. Installing TinyMCE with Composer will benefit the version we have already in OpenMage or do we need some patches for Composer?

@sreichel
Copy link
Contributor Author

@addison74 i have seen no changes made to TinyMCE itself, so the files are the same as currently used.

@sreichel
Copy link
Contributor Author

@addison74 note: when you install OM as composer dependency, you have to install that plugin too.

@sreichel
Copy link
Contributor Author

Waiting for final response from TinyMCE, but it looks like we CAN use v7 ...

Maybe some is really familiar with licensing ... answer so far.

GPL Version 2 or later grants users the freedom to use, modify, and distribute software, as long as any derivative works are also distributed under the same license and the source code is made available to recipients.

In simplified terms, this means that when distributing an app containing GPL licensed code, the whole app will inherit the GPL license and the source code must be made available to the community. This is usually a no-go in a commercial use case.

OM is no derivative work from TinyMCE, so we dont have to put it under GPL itself.

We use it in a non-commercial project. We follow (inherit?) GPL and all code is available to the community.

From my understanding ... if someone uses a OM-fork as commercial product, HE had to put it under GPL - not we.

Waiting for response, but v7 seems to work ...

@addison74
Copy link
Contributor

I didn't think to contact them, but what you say there seems to make sense. If we get an official answer that we can use version 7, that would be wonderful. If I'm not mistaken, Magento 2 is still at version 5.

@addison74
Copy link
Contributor

@sreichel - Did you get any reply from TinyMCE regarding using v7 in OpenMage?

@sreichel
Copy link
Contributor Author

sreichel commented Aug 22, 2024

@addison74 i dont know ... my email-account is currently locked and seems not so easy to get it unlocked.

With this PR we are prepared for a possible 6.8.5 release that will come "for sure" (6.8 is supported till next year).

@github-actions github-actions bot removed the phpstan label Sep 6, 2024
@github-actions github-actions bot added the composer Relates to composer.json label Nov 29, 2024
@github-actions github-actions bot added the git label Nov 30, 2024
@sreichel sreichel mentioned this pull request Dec 7, 2024
@kiatng
Copy link
Contributor

kiatng commented Dec 8, 2024

I'm not sure how to test. What I did in DDEV:

  1. [bash] gb pr checkout 4113
  2. [bash] composer upgrade
  3. [browser] OpenMage admin > CMS > Pages > select any page > Contents > Show Editor > Help > Version

I get: "You are using TinyMCE 6.8.4" but I expect 7.5. What am I missing?

[edit] My browser was loading the TinyMCE from cache. When I refreshed with ctrl-F5, and click Show/Hide Editor button, developer console error:

GET https://openmage.ddev.site/js/tinymce/tinymce.min.js net::ERR_ABORTED 404 (Not Found)
26f643ca40eef9198d0cc35c61fb485c/:68 
        
        
       GET https://openmage.ddev.site/js/tinymce/tinymce.min.js net::ERR_ABORTED 404 (Not Found)
setup.js:218 Uncaught ReferenceError: tinymce is not defined
    at klass.toggle (setup.js:218:9)
    at HTMLButtonElement.<anonymous> (prototype.js:7273:15)
toggle @ setup.js:218
(anonymous) @ prototype.js:7273

@addison74
Copy link
Contributor

@kiatng - How did you install OpenMage in the directory configured to use DDEV?

@sreichel sreichel marked this pull request as draft December 8, 2024 20:57
@sreichel
Copy link
Contributor Author

sreichel commented Dec 8, 2024

Ahhh ... i forgot to commit some changes to composer-plugin.

OpenMage/composer-plugin@43369eb

@sreichel
Copy link
Contributor Author

sreichel commented Dec 8, 2024

Sorry for missing commit.

Tested again.

Github install (checkout repo + composer install)
tiny--om

Composer install with custom magento-root-dir (as nin config above)
tiny--om--composer

If it still shows v6.8 please run composer install -v to show tinymce version or -vv to see copy paths.

@sreichel sreichel marked this pull request as ready for review December 8, 2024 23:21
@sreichel
Copy link
Contributor Author

sreichel commented Dec 9, 2024

@kiatng - How did you install OpenMage in the directory configured to use DDEV?

If you want to install with ddev command, please check this code ... #4407

To make DDEV commands available for composer installs, they move to a ddev-addon. Later.

kiatng
kiatng previously approved these changes Dec 9, 2024
addison74
addison74 previously approved these changes Dec 9, 2024
@sreichel sreichel dismissed stale reviews from addison74 and kiatng via 1430ea7 December 9, 2024 06:21
@sreichel
Copy link
Contributor Author

sreichel commented Dec 9, 2024

... conflicts fixed ... grrr

@sreichel sreichel requested review from addison74 and kiatng December 9, 2024 06:24
@sreichel sreichel merged commit c47df5b into OpenMage:main Dec 9, 2024
21 checks passed
@sreichel sreichel deleted the tinymce branch December 9, 2024 08:14
@sreichel
Copy link
Contributor Author

sreichel commented Dec 9, 2024

We did it. 👍

@sreichel sreichel removed the review needed Problem should be verified label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Adminhtml Relates to Mage_Adminhtml Component: Widget Relates to Mage_Widget composer Relates to composer.json git JavaScript Relates to js/* PHPStorm phpunit Template : admin Relates to admin template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants