update from 5.0.0-alpha to 5.0.0-beta1-dev
jtemplate icon should be still there
in parameter of plugin (in database) it is now jjtemplate (double j)
#40626: migrateTinymceConfiguration is triggered because version_compare('5.0.0-alpha/beta', '5.0.0', 'ge')
is false
joomla-cms/administrator/components/com_admin/script.php
Lines 2295 to 2307 in 6e420fb
Labels |
Added:
No Code Attached Yet
|
The double jj
means that the upgrade procedure run twice, the first changed template
to jtemplate
and the second the jtemplate
to jjtemplate
. @richard67 any clues why?
@HLeithner wasn't Fedir's fault, coming from #40626
It's a new installation of j5 - so it is already jtemplate
.
Then I do an update from 5.0.0-alpha --> 5.0.0-beta1-dev (nightly)
In the postflight function of administrator\components\com_admin\script.php
it do an version compare which is false for 5.0.0 alpha or beta versions version_compare($this->fromVersion, '5.0.0', 'ge')
and migrateTinymceConfiguration
is executed
After this it's jjtemplate
#40626 : migrateTinymceConfiguration is triggered because
version_compare('5.0.0-alpha/beta', '5.0.0', 'ge') is false
@heelc29 That's indended, we want to run it when updating from 5.0 alpha versions.
@dgrammatiko The problem is that after the replacement, the value still contains "template", so it will match and be replaces again and again. We need a check (in addition to the version compare) if the parameters contain one of the old values which is not there after a successful replacement. Or we have to use regexp_replace so we can use the beginning of sting anchor.
it do an version compare which is false
Ok, that explains why it happens. I have no clue if we should guard against it but should be doable
@dgrammatiko Do you want to provide a fix, and I review it? Or vice versa?
Labels |
Added:
bug
|
Do you want to provide a fix, and I review it? Or vice versa?
Go ahead and I'll do the testing
Go ahead and I'll do the testing
@dgrammatiko It may take a while because I have to go shopping for food soon before they close.
The easiest check would be if we already have a 'jtemplate'
. If that is the case, the replacement has already been made or we are already on a J5 where it is right.
Yup, you can add something like
if (!str_contains($params['configuration']['toolbars'][$setIdx]['menu'], 'jtemplate) {
// add to the array
}
// exec the str_replace
It may take a while because I have to go shopping for food soon before they close.
@richard67 no worries, I'll do the PR
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-08-26 13:49:42 |
Closed_By | ⇒ | heelc29 |
@Fedik ?