Upgrade a site from Joomla 3 to Joomla 4. After the upgrade you'll notice several items missing required assets
No asset issues on upgrade
Missing assets on upgrade
Issues found thanks to the PWT ACL Manager whilst upgrading our core sites
Labels |
Added:
No Code Attached Yet
|
I know but that's why we've had the refresh assets in script.php since joomla update was introduced in 2.5
I know but that's why we've had the refresh assets in script.php since joomla update was introduced in 2.5
@wilsonge But this works only for assets on level 1 which are direct child of the root asset, it doesn’t work for level 2 and below.
Besides this, not all tables have a getParentAsset (or so) method, so if you e.g. create a new scheduled task, that task has a level 1 asset. We should fix that first if it’s an issue before we add something g to create such assets on update.
After updating a 4.3.x to the news stable version, all backend modules with assed_id = 0 were duplicated. I updated with upload and update. This will result in tons of user issues and so I think it needs a quick solution.
I don't think this is related to the asset_ids, and I never have seen that with a clean install. Maybe there was something wrong with the schema version in database so the SQL update script has run a 2nd time?
I never had it on fresh installation, of course.
And not on installations which were set up with J4. This is an old site, upgraded from J3 in many steps.
The schema version could be a hint, thank you.
I found the issue when I updated the site (local copy). Not testing any PR.
I was wondering how my backend looks after the update and noticed is that only modules with asset_id = 0 are duplicated
only modules with asset_id = 0 are duplicated
Well, that is because when we insert new modules with update SQL scripts, we use asset_id zero (or not use asset_id at all, which has the same result. So if an update SQL runs a 2nd time and inserts the same modules again, they will again have asset_id zero.
@chmst The modules are inserted with this update script here: https://github.com/joomla/joomla-cms/blob/4.3-dev/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-07-13.sql#L29-L107
So if they have been inserted twice, the schema version in database was either missing or smaller than "4.0.0-2019-07-13".
The schema version of the core is the record in table #__schemas
which belongs to the extension named 'files_joomla'.
@chmst Do you have SQL update scripts with the following names in folder "administrator/components/com_admin/sql/updates/mysql":
If these 4 scripts exists, then they are the problem. They have been combined together into a new script "4.0.0-2019-07-13.sql" with PR #25570 before 4.0.0 stable, i.e. during alpha or beta phase. But this would mean that the duplicate modules have been already created when updating to 4.0, and that it was an alpha or beta which was used for that.
Or it is like I wrote before that the schema version was not ok.
@chmst Another way how the duplicate modules can happen is when you have a failed update from 3.10 and you restore a backup from before the update, but you haven't used an empty database for that, and then you update again from 3.10, this time successful. But with updating a clean 4.3.0 or 4.3.1 or 4.3.2 to 4.3.3 this should not happen.
Thanks for investigating. I don't have these files. I will repeat the udate on a new copy of my site and see what happens.
FYI I have seen a few reports recently the same as @chmst
Me too, but as I've never had a pre-update backup to check that, I don't really know the reason for the issue. I only can make assumption based on my knowledge on how it should work and where problems could come from.
Labels |
Added:
bug
|
@wilsonge We don’t insert new assets with update SQL scripts because we can’t really know the right lft and rgt values when inserting them.