No Code Attached Yet bug
avatar roumilb
roumilb
24 Nov 2022

Steps to reproduce the issue

  1. Create an extension and load an editor in it (for exemple AcyMailing) with custom config
  2. Select TinyMCE as the default editor in Joomla configuration
  3. Go to the TinyMCE plugin settings and save the form (you don't have to change anything)
  4. Load the editor in the plugin (in AcyMailing create a new template with the website editor, save it and then refresh it)

Expected result

Displays TinyMCE editor

Actual result

PHP Fatal error

System information (as much as possible)

Fatal error: Attempt to assign property "joomlaBrokeItInAMinorRelease" on array

Call stack
--
# | Function | Location
1 | () | JROOT/libraries/vendor/joomla/registry/src/Registry.php:766
2 | Joomla\Registry\Registry->bindData() | JROOT/libraries/vendor/joomla/registry/src/Registry.php:761
3 | Joomla\Registry\Registry->bindData() | JROOT/libraries/vendor/joomla/registry/src/Registry.php:761
4 | Joomla\Registry\Registry->bindData() | JROOT/libraries/vendor/joomla/registry/src/Registry.php:278
5 | Joomla\Registry\Registry->loadArray() | JROOT/libraries/src/Editor/Editor.php:298
6 | Joomla\CMS\Editor\Editor->_loadEditor() | JROOT/libraries/src/Editor/Editor.php:170
7 | Joomla\CMS\Editor\Editor->display() | JROOT/administrator/components/com_acym/helpers/editor.php:165
8 | AcyMailing\Helpers\EditorHelper->displayJoomla() | JROOT/administrator/components/com_acym/helpers/editor.php:83
9 | AcyMailing\Helpers\EditorHelper->display() | JROOT/administrator/components/com_acym/views/mails/tmpl/edit.php:41
10 | include() | JROOT/administrator/components/com_acym/libraries/view.php:113
11 | AcyMailing\Libraries\acymView->display() | JROOT/administrator/components/com_acym/libraries/controller.php:210
12 | AcyMailing\Libraries\acymController->display() | JROOT/administrator/components/com_acym/controllers/mails.php:450
13 | AcyMailing\Controllers\MailsController->edit() | JROOT/administrator/components/com_acym/libraries/controller.php:104
14 | AcyMailing\Libraries\acymController->call() | JROOT/administrator/components/com_acym/acym.php:73
15 | require_once() | JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
16 | Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() | JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
17 | Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() | JROOT/libraries/src/Component/ComponentHelper.php:355
18 | Joomla\CMS\Component\ComponentHelper::renderComponent() | JROOT/libraries/src/Application/AdministratorApplication.php:143
19 | Joomla\CMS\Application\AdministratorApplication->dispatch() | JROOT/libraries/src/Application/AdministratorApplication.php:186
20 | Joomla\CMS\Application\AdministratorApplication->doExecute() | JROOT/libraries/src/Application/CMSApplication.php:294
21 | Joomla\CMS\Application\CMSApplication->execute() | JROOT/administrator/includes/app.php:61
22 | require_once() | JROOT/administrator/index.php:32

Additional comments

The error only appear when you load TinyMCE with custom parameters and you already save the TinyMCE settings.
For exemple in AcyMailing we add a custom config to TinyMCE to add custom CSS to the render, we do it in the file administrator/components/com_acym/helpers/editor.php with this structure:

$this->editorConfig['configuration'] = (object)[
                    'toolbars' => (object)['joomlaBrokeItInAMinorRelease' => []],
                    'setoptions' => [
                        'joomlaBrokeItInAMinorRelease' => (object)[
                            'access' => $access,
                            'content_css' => '0',
                            'content_css_custom' => $cssurl.'&local=http',
                        ],
                    ],
                ];

The fatal happens in libraries/vendor/joomla/registry/src/Registry.php:766 in the bind function because it tries to assign an object key to an array.
The error comes from when we save the TinyMCE plugin settings, it transform the params from an object to an array.
I've tested it on Joomla 3 and after saving the TinyMCE plugin settings it work.

avatar roumilb roumilb - open - 24 Nov 2022
avatar joomla-cms-bot joomla-cms-bot - change - 24 Nov 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 Nov 2022
avatar SharkyKZ
SharkyKZ - comment - 25 Nov 2022

joomlaBrokeItInAMinorRelease

Heh. In which release did it start happening though?

avatar roumilb
roumilb - comment - 25 Nov 2022

I don't have a specific version but it's one of the latest Joomla 4 version

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023

Add a Comment

Login with GitHub to post a comment