No Code Attached Yet
avatar Quy
Quy
1 Dec 2021

Steps to reproduce the issue

Go to System > Plugins
Edit Editor - TinyMCE plugin.
Click Save & Close button.

Create or edit an article.
See error.

Actual result

Notice: Trying to get property '0' of non-object in \plugins\editors\tinymce\tinymce.php on line 200

avatar Quy Quy - open - 1 Dec 2021
avatar joomla-cms-bot joomla-cms-bot - change - 1 Dec 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Dec 2021
avatar Quy Quy - change - 1 Dec 2021
Labels Added: Release Blocker
avatar Quy Quy - labeled - 1 Dec 2021
avatar brianteeman
brianteeman - comment - 1 Dec 2021

Is this a completely clean installation?

avatar brianteeman
brianteeman - comment - 1 Dec 2021

I could not replicate this on a completely clean install

avatar chmst
chmst - comment - 1 Dec 2021

I cannot replicate the error on the site where I am working on (4.0.5 dev, not empty)

avatar brianteeman
brianteeman - comment - 1 Dec 2021

The reason that I said not empty was that I could replicate it on an install that had moved up to 4.1 and then back to 4.0

avatar Quy
Quy - comment - 1 Dec 2021

4.0.4 Clean install OK
4.0.5 Clean install of the nightly build. NOT OK

36179

avatar dgrammatiko
dgrammatiko - comment - 1 Dec 2021

$toolbarParams = $toolbarParamsAll->{$set}; should do

avatar Quy
Quy - comment - 1 Dec 2021

Same error. Initially, it is an object. After saving TinyMCE settings, it is an array.

Before:

object(stdClass)[1058]
  public '2' => 
    object(stdClass)[1057]
      public 'toolbar1' => 
        array (size=11)
          0 => string 'bold' (length=4)
          1 => string 'underline' (length=9)
          2 => string 'strikethrough' (length=13)
          3 => string '|' (length=1)
          4 => string 'undo' (length=4)
          5 => string 'redo' (length=4)
          6 => string '|' (length=1)
          7 => string 'bullist' (length=7)
          8 => string 'numlist' (length=7)
          9 => string '|' (length=1)
          10 => string 'pastetext' (length=9)

After:

array (size=3)
  0 => 
    object(stdClass)[1066]
      public 'menu' => 
        array (size=6)
          0 => string 'edit' (length=4)
          1 => string 'insert' (length=6)
          2 => string 'view' (length=4)
          3 => string 'format' (length=6)
          4 => string 'table' (length=5)
          5 => string 'tools' (length=5)
avatar dgrammatiko
dgrammatiko - comment - 1 Dec 2021

Try

$extraOptionsAll  = (object) $this->params->get('configuration.setoptions', array());
$toolbarParamsAll = (object) $this->params->get('configuration.toolbars', array());
avatar Quy
Quy - comment - 1 Dec 2021

It fixed it, however, menu is missing (Edit, Insert, View...).

Before saving settings:
tinymce-before

After saving settings:
tinymce-after

avatar dgrammatiko
dgrammatiko - comment - 1 Dec 2021

Can you reverse the array and then cast it to an object?

avatar Quy
Quy - comment - 1 Dec 2021

Sorry I don't understand. Another issue is that it is displaying set 2 and not set 0 after saving TinyMCE settings. Something else is going on since v4.0.4.

avatar brianteeman
brianteeman - comment - 1 Dec 2021

@Quy but two of us can not replicate your issue

avatar Quy Quy - change - 1 Dec 2021
Labels Removed: Release Blocker
avatar Quy Quy - unlabeled - 1 Dec 2021
avatar Quy
Quy - comment - 1 Dec 2021

Yes, I understand. Hopefully, it is an isolated case. If no one else can reproduce it, I will close it by tomorrow.

avatar Fedik
Fedik - comment - 2 Dec 2021

@Quy did you edited TinyMCE plugin options after installation, or not? so they is default now

Something else is going on since v4.0.4.

there was PR #36066

One thing I can guess, before the PR we had keys as 2 1 0 and JRegistry store it as object,
after changing order to 0 1 2 JRegistry store it as array.
This need to check.

avatar Fedik Fedik - change - 2 Dec 2021
Labels Added: Release Blocker
avatar Fedik Fedik - labeled - 2 Dec 2021
avatar joomdonation
joomdonation - comment - 2 Dec 2021

Just tried and can confirm the issue with today nightly build!

avatar infograf768
infograf768 - comment - 2 Dec 2021

Confirmed here (last 4.0.5-dev)
Screenshot 2021-12-02 at 10 01 48

avatar dgrammatiko
dgrammatiko - comment - 2 Dec 2021

Reversing this

for ($i = 0; $i < $setsAmount; $i++)
{
$data['setsNames'][$i] = Text::sprintf('PLG_TINY_SET_TITLE', $i);
}

to

		// Get array of sets names
		for ($i = $setsAmount; $i >= 0; $i--)
		{
			$data['setsNames'][$i] = Text::sprintf('PLG_TINY_SET_TITLE', $i);
		}

Seems to do the trick. (keep the typecasting and the other ->{$set} from my previous comments)

@Fedik since the whole tinyMCE builder is mostly your code can you confirm that this is correct? If so, then someone needs to do a PR with the changes

avatar Fedik
Fedik - comment - 2 Dec 2021

This will revert changes from #36066 ;)
There should be another solution, I will look later

avatar dgrammatiko
dgrammatiko - comment - 2 Dec 2021

This will revert changes from #36066 ;)

No, the tabs are still in the right order (0, 1, 2) and the data is also correctly correlated to the right number. Anyways you might have a better solution 😉

Edit, you're right this reverses the order of tabs

avatar brianteeman
brianteeman - comment - 2 Dec 2021

Probably the code that @Fedik changed in my pr that is causing this ;)

avatar Fedik Fedik - change - 2 Dec 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-12-02 19:16:19
Closed_By Fedik
avatar Fedik Fedik - close - 2 Dec 2021
avatar Fedik
Fedik - comment - 2 Dec 2021

Please test #36186

avatar Fedik Fedik - change - 2 Dec 2021
Labels Removed: Release Blocker
avatar Fedik Fedik - unlabeled - 2 Dec 2021

Add a Comment

Login with GitHub to post a comment