All add-ons currently require PHP 7.4 or greater.
On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.
Please read about the changes to BoldMinded add-on licensing.
Ticket: Publisher Lite causing custom RTE javascript to fail
Status | Resolved |
Add-on / Version | Publisher Lite 3.11.2 build b5bf531a |
Severity | |
EE Version | 7.3.14 |
Ben Houghton
Jun 27, 2024Description of the problem Hi, I don’t know how theses things are related but once publisher lite is installed it causes the request that adds a custom JS template to RTE to fail.
- Clean install of EE 7.4.11 (it was also on 7.4.9)
- Create a template group called javascript
- Create a template of type Javascript in the new group and call it custom
- Add a simple
console.log('CUSTOM JS LOADED')
5 Go to the Add-ons and edit the RichText Editor settings, scroll down to “Available Tool Sets” and select RedatorX Full(it can be any RTE, but I will use RedatorX Full in this example) click into the RedatorX Full settings. Turn on “Advanced configuration” and go to the “Extra JavaScript” dropdown and select the javascript/custom template that was just created. Save. - Create a new Field of type “Rich Text Editor” scroll down to the “Editor Configuration” dropdown and select RedatorX Full, all other options toggled to off. Save.
- Create a new channel, in the fields tab and add the the new field from above, everything else set to default.
- Create a new entry in the channel above, over up the console and and you will see the console log message from the custom JS.
- Install the Publisher Lite Add-on.
- Go back and create/edit an entry again (you may need to hard refresh if it does not show) but in the console now you will see some errors. In the network tab you will notice that the request that has “&template=4&” in the query string is now failing.
At this point I can uninstall Publisher, go back to the entry and the error is gone. Install publisher, go to the entry, hard refresh the browser and the errors are back.
Error Messages Console Error
admin.php:712
GET https://dev.ee.theinsuranceemporium.co.uk/admin.php?/cp&C=javascript&M=combo_load&file=cp/global_end,cp/files/picker,fields/file/file_field_drag_and_drop,fields/file/concurrency_queue,fields/file/file_upload_progress_table,fields/file/drag_and_drop_upload,fields/grid/file_grid,fields/rte/redactorx/redactor.min,fields/rte/rte,cp/date_picker&template=4&v=1719504798 net::ERR_ABORTED 500 (Internal Server Error)
Environment Details: - Version: 3.11.2 build b5bf531a - PHP Version: 8.1.29 - MySQL Version: 8.0.35 - OS: Docker - Web Server: nginx
BoldMinded (Brian)
I found what I think is a fix for Publisher, but after implementing it I’m still getting an EE internal error (you can see in the stack trace below that no Publisher files are getting called). If you turn up your EE debugging and open the URL that is appearing in your console in a new tab you should see the full error.
Getting up on my high horse for a moment. CSS and JS files should not be managed in EE’s templates folder. That option is a relic of EE 1 and 2 days before JS build tools existed, and if you’re not using build tools then I recommend just using standalone .js files not EE template files set to the JavaScript or CSS type.
BoldMinded (Brian)
Sorry for that last rant. I’m just surprised EE is still allowing JS and CSS files to be templates. The issue is that since it’s a template, a ton of extra processing is happening just to serve a static .js file, which should be served by Apache or Nginx, not a CMS. So we’re running into an issue where were a crap ton of PHP logic is being executed for no reason at all.
BoldMinded (Brian)
Comment has been marked private.
Ben Houghton
Comment has been marked private.
BoldMinded (Brian)
Is there anything else to that error message? A stack trace perhaps so I know what is attempting to load that file?
Ben Houghton
Comment has been marked private.
BoldMinded (Brian)
Comment has been marked private.
Ben Houghton
Comment has been marked private.