J4 Issue
avatar richard67
richard67
22 Mar 2020

Steps to reproduce the issue

  1. Install a fresh copy of 3.10 nightly.
  2. Go to the Joomla Update Component component config and set the URL to custom (https://update.joomla.org/core/nightlies/next_major_list.xml) and the status to development.
  3. Update to Joomla 4.0
  4. After files are successfully written and you re-authenticate (with a known issue about incorrect templates warnings when you do this) then you'll get following error shown after the first login to
    backend:
    j4-error-after-update-from-3-10

When then navigating through the backend, all is ok. Frontend works, too. The error message never appears again.

Expected result

No error shown after first login to backend after update from 3.10 to 4.0.

Actual result

Error shown after first login to backend after update from 3.10 to 4.0, see steps to reproduce.

System information (as much as possible)

PHP 7.3, MySQL 8, Linux

Additional comments

The aministrator/logs/joomla_update.php shows that all SQL changes have been applied, compared to the update sql files. So it is not caused by any SQL error like it was reported with issue #28385 and solved with PR #28391 .

The changes from PR #28399 are implemented too, and the PHP warning logged in the PHP log which was present before PR #28399 was merged does not appear anymore. But the error shown in the screenshot above is the same as the one handled with PR #28399.

avatar richard67 richard67 - open - 22 Mar 2020
avatar richard67
richard67 - comment - 22 Mar 2020

Ping @wilsonge .

avatar richard67 richard67 - change - 22 Mar 2020
Labels Added: ?
avatar richard67 richard67 - labeled - 22 Mar 2020
avatar richard67 richard67 - change - 22 Mar 2020
Labels Added: J4 Issue
avatar richard67 richard67 - labeled - 22 Mar 2020
avatar richard67 richard67 - change - 22 Mar 2020
Build staging 4.0-dev
avatar richard67 richard67 - change - 22 Mar 2020
Priority Medium Urgent
avatar richard67
richard67 - comment - 22 Mar 2020

@wilsonge Maybe it needs some additional cache cleaning in between the steps, deleting old plugin and deleting unused files and folders?

avatar zero-24
zero-24 - comment - 22 Mar 2020

Do you have a stack trace? Where this error is coming from?

avatar richard67 richard67 - change - 22 Mar 2020
The description was changed
avatar richard67 richard67 - edited - 22 Mar 2020
avatar richard67
richard67 - comment - 22 Mar 2020

No idea. I have full error log to file on in my PHP settings, but there is no error logged in the log file.

avatar richard67
richard67 - comment - 22 Mar 2020

But normally this error comes when trying to read XML files but the file is not there.

avatar richard67
richard67 - comment - 22 Mar 2020

It should have been solved with #28399 , but seems that wasn't enough.

avatar zero-24
zero-24 - comment - 22 Mar 2020

what happens when you enable the debug plugin? Any more info displayed than?

avatar richard67
richard67 - comment - 22 Mar 2020

@zero-24 Thanks for kicking my ass to the debugger ;-)

Call stack
--
# | Function | Location
1 | () | JROOT/libraries/src/Installer/Adapter/PluginAdapter.php:424
2 | Joomla\CMS\Installer\Adapter\PluginAdapter->setupUninstall() | JROOT/libraries/src/Installer/InstallerAdapter.php:1180
3 | Joomla\CMS\Installer\InstallerAdapter->uninstall() | JROOT/libraries/src/Installer/Installer.php:764
4 | Joomla\CMS\Installer\Installer->uninstall() | JROOT/administrator/components/com_admin/script.php:412
5 | JoomlaInstallerScript->uninstallRepeatableFieldsPlugin() | JROOT/administrator/components/com_admin/script.php:96
6 | JoomlaInstallerScript->update() | JROOT/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php:866
7 | Joomla\Component\Joomlaupdate\Administrator\Model\UpdateModel->finaliseUpgrade() | JROOT/administrator/components/com_joomlaupdate/src/Controller/UpdateController.php:180
8 | Joomla\Component\Joomlaupdate\Administrator\Controller\UpdateController->finalise() | JROOT/libraries/src/MVC/Controller/BaseController.php:728
9 | Joomla\CMS\MVC\Controller\BaseController->execute() | JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:146
10 | Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() | JROOT/libraries/src/Component/ComponentHelper.php:384
11 | Joomla\CMS\Component\ComponentHelper::renderComponent() | JROOT/libraries/src/Application/AdministratorApplication.php:131
12 | Joomla\CMS\Application\AdministratorApplication->dispatch() | JROOT/libraries/src/Application/AdministratorApplication.php:174
13 | Joomla\CMS\Application\AdministratorApplication->doExecute() | JROOT/libraries/src/Application/CMSApplication.php:231
14 | Joomla\CMS\Application\CMSApplication->execute() | JROOT/administrator/includes/app.php:63
15 | require_once() | JROOT/administrator/index.php:36

It seems it fails when uninstalling the repeatable fields plugin.

avatar zero-24
zero-24 - comment - 22 Mar 2020

hmm seams to be something broken in the uninstall of the plugin uninstallRepeatableFieldsPlugin.

avatar richard67
richard67 - comment - 22 Mar 2020

Yep, am checking, but haven't found the mistake yet ;-)

avatar richard67
richard67 - comment - 22 Mar 2020

The $this->group = (string) $this->getManifest()->attributes()->group; in the PluginAdapter fails. It seems it doesn't find any manifest file.

avatar richard67
richard67 - comment - 22 Mar 2020

Or it doesn't have a group attribute.

avatar richard67
richard67 - comment - 22 Mar 2020

Maybe order of processing in function uninstallRepeatableFieldsPlugin() in file script.phpis wrong? To me it seems to be ok. Or maybe we should do the $db->transactionCommit(); there before we run the installer to uninstall the plugin, and not after like it is now?

avatar richard67
richard67 - comment - 22 Mar 2020

@Hackwar Any idea?

avatar zero-24
zero-24 - comment - 22 Mar 2020

https://github.com/joomla/joomla-cms/blob/staging/plugins/fields/repeatable/repeatable.xml#L2

hmm the xml looks good to me maybe the path used is not the correct one?

avatar mbabker
mbabker - comment - 22 Mar 2020

Is that function running before or after the plugin was removed from the filesystem? It doesn’t matter if the manifest looks right or not, if it’s not there then you’re SOL.

avatar richard67
richard67 - comment - 22 Mar 2020

@mbabker It was changed with PR #28399 to run before the removal from file system. And after the update, the script.php which is there includes that change.

avatar wilsonge
wilsonge - comment - 22 Mar 2020

It's related to this https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_joomlaupdate/restore_finalisation.php#L75

I forgot at the end of restore.php we trash all the files :( That's before we call the usual script methods. Which is unfortunate. Not really sure how best to work around that.

avatar richard67
richard67 - comment - 22 Mar 2020

@wilsonge At least we have an explanation now. Easy fix: Add it to the readme of the known issues like we have it (hopefully) for the "template style does not exist" message ;-) (joking)

avatar richard67
richard67 - comment - 22 Mar 2020

@wilsonge Could we exclude the files and folders of that plugin from the delete files routine and the delete folders (and also from the script to generate those lists)? Shouldn't the uninstallation of the plugin remove that stuff already?

avatar richard67
richard67 - comment - 22 Mar 2020

Alternatively, we could change the function uninstallRepeatableFieldsPlugin in script.php so it doesn't uninstall the plugin anymore using the extensions installer but is deleting database stuff like e.g. the record in the extensions table itself.

avatar wilsonge
wilsonge - comment - 22 Mar 2020

@wilsonge Could we exclude the files and folders of that plugin from the delete files routine and the delete folders (and also from the script to generate those lists)? Shouldn't the uninstallation of the plugin remove that stuff already?

Yes I think that's the correct thing to do

avatar richard67
richard67 - comment - 22 Mar 2020

Have just tested with a patched update zip and it works.

avatar richard67
richard67 - comment - 22 Mar 2020

Patch was change in script.php as shown here: 4.0-dev...richard67:4.0-dev-test-issue-28432

avatar richard67
richard67 - comment - 22 Mar 2020
avatar zero-24
zero-24 - comment - 22 Mar 2020

looks good to me. ?

avatar richard67
richard67 - comment - 22 Mar 2020

@zero-24 Problem is it doesn't make sense that I make a PR with that fix. @wilsonge has to change the procedure to generate these lists in script.php instead.

avatar wilsonge
wilsonge - comment - 22 Mar 2020

Make the PR its fine

avatar richard67
richard67 - comment - 22 Mar 2020

You mean I shall make? Ok, will do so.

avatar wilsonge
wilsonge - comment - 22 Mar 2020

a342106 script updated. just do the PR :) saves me from downloading nightlies and doing diff's :)

avatar richard67
richard67 - comment - 22 Mar 2020

Closing as having PR. Please test #28433 .

avatar richard67 richard67 - close - 22 Mar 2020
avatar richard67 richard67 - change - 22 Mar 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-03-22 17:18:26
Closed_By richard67
avatar richard67
richard67 - comment - 22 Mar 2020

a342106 script updated. just do the PR :) saves me from downloading nightlies and doing diff's :)

@wilsonge LGTM.

avatar wilsonge wilsonge - change - 22 Mar 2020
Labels Removed: ?
avatar wilsonge wilsonge - unlabeled - 22 Mar 2020

Add a Comment

Login with GitHub to post a comment