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, 2024

Description 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.

  1. Clean install of EE 7.4.11 (it was also on 7.4.9)
  2. Create a template group called javascript
  3. Create a template of type Javascript in the new group and call it custom
  4. 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.
  5. 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.
  6. Create a new channel, in the fields tab and add the the new field from above, everything else set to default.
  7. 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.
  8. Install the Publisher Lite Add-on.
  9. 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

#1

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.

No such property: 'session' on ExpressionEngine\Legacy\Facade

ee/ExpressionEngine/Legacy/Facade.php:128

Stack Trace: Please include when reporting this error

#0 ee/ExpressionEngine/Legacy/Facade.php(35): ExpressionEngine\Legacy\Facade->get('session')
#1 ee/legacy/libraries/Functions.php(53): ExpressionEngine\Legacy\Facade->__get('session')
#2 ee/legacy/libraries/Functions.php(204): EE_Functions->fetch_site_index(1)
#3 ee/legacy/libraries/Template.php(349): EE_Functions->fetch_current_uri()
#4 ee/legacy/libraries/Template.php(248): EE_Template->parse('console.log('hi...', false, 1, false)
#5 ee/legacy/libraries/Javascript_loader.php(64): EE_Template->fetch_and_parse('javascript', 'custom', false, 1)
#6 ee/legacy/controllers/cp/javascript.php(182): Javascript_loader->combo_load()
#7 [internal function]: Javascript->combo_load()
#8 ee/ExpressionEngine/Core/Core.php(268): call_user_func_array(Array, Array)
#9 ee/ExpressionEngine/Core/Core.php(124): ExpressionEngine\Core\Core->runController(Array)
#10 ee/ExpressionEngine/Boot/boot.php(184): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))
#11 admin.php(140): require_once('...')
#11 admin.php(140): require_once('...')
#2

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.

#3

BoldMinded (Brian)

Comment has been marked private.

#4

Ben Houghton

Comment has been marked private.

#5

BoldMinded (Brian)

Is there anything else to that error message? A stack trace perhaps so I know what is attempting to load that file?

#6

Ben Houghton

Comment has been marked private.

#7

BoldMinded (Brian)

Comment has been marked private.

#8

Ben Houghton

Comment has been marked private.

Login to reply