-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assets not loaded after upgrading from 4.0 to 4.1 #36567
Comments
confirmed and why I raised #36423 |
|
The static files exist in the update package: But I think both of you are on Windows and the finilisation part of the update is failing silently thus you have the db structure warnings. I think I know what's failing here but I need to coordinate the fix with @richard67 (remember that we skipped/patched the Path::clean or something similar in the script.php?). |
@joeforjoomla Does that mean you just have uploaded and unpacked the zip file e.g. via FTP or SSH access and then run the database fixer? Or does that mean you have used the "Upload & Update" method of the Joomla Update Component? The first way, upload manually and then use the DB fixer, is not a valid update method anymore since Joomla 3.5. You HAVE TO use the update component. |
@dgrammatiko What we have done in script.php was only for the copying of any custom files in the template folder. It should not cause such a problem with missing assets because the stuff in script.php runs AFTER the zip package has been unpacked and AFTER the old obsolete core files have been deleted and BEFORE the old obsolete core folders are deleted.. |
Nope, the file part comes before the db changes, so if it fails the script won't get the db updates. The error here is obvious as the templates should have their styles table updated (column inheritable needs to be 1 not 0). This is obviously what's missing here, either @brianteeman or @joeforjoomla could verify it. |
I have already confirmed in another issue that if an SQL silently fails then the remove files doesn't happen |
@richard67 @dgrammatiko installing the package with 'Upload and update' does not work. I have to manually COPY BACK assets files from the /media folder to the templates folder, both backend and frontend |
@joeforjoomla I see. Thanks for clarifying. |
I will ask again: is this a windows based server? |
yes but it doeznt matter. If the sql fails (silently) then the script.php step is missed ou and it goes straight to telling you the update was a success |
It's not the db part but some filesystem related operation that fails here. The comments following #35874 (comment) should give us a hint of what's failing. The bad news here is that I cannot patch this blindly (I don't have a windows based PC around) so someone else needs to debug it. |
@dgrammatiko it's a standard Apache server on a Windows PC |
@joeforjoomla @brianteeman could you test upgrading to 4.1 using the package from #36574 |
@dgrammatiko just tested #36574 but still same issue. |
@joeforjoomla If you hover over the "2 Problems" badge, which details are shown in the tool tip? |
@richard67 at the moment database problems are no longer displayed, the schema structure has been updated. |
@joeforjoomla do you
|
@brianteeman The one problem about update version not matching the CMS version can be ignored. You always get that when using (i.e, installing a or updating to a) patched package built by drone for a PR. |
@richard67 ok - was just reporting for completeness |
@brianteeman @joeforjoomla could you test #36574 once the Drone is done? The change there now will not run the code for the templates files sync so if it works then it's an obvious indication that the code that syncs the assets is failing. Thanks |
I can confirm that I can update on windows with a completely clean install using BOTH nightly and the build packages from the PR I can also tell you how to replicate the screenshot in #36567 (comment). To Replicate you need to force an sql error in the update which is easy to happen when you've been doing a lot of testing but if you need to force it then just change the template_id of any of the mail_templates in the database to plg_system_tasknotification.failure_mail Now when you do the joomla update it will silently fail on the sql and you will end up with the same screen as @joeforjoomla |
@brianteeman the db failure might as well be a valid reason why the update failed but in this case the problem comes from my code. Here's the order of execution: So the break should be in the |
Which is exactly what i said before in my first issue |
@dgrammatiko after the upgrade to 4.1 i have * have the |
One solution is to wrap every db update part in |
We should not do that in a way so that if one SQL statement fails then the next one runs. This would cause a mess. We have to end SQL scripts execution if an error happens with an SQL statement. |
There's an obvious easy test here:
|
@dgrammatiko i've just done this test but nothing changes. Still the same issue. |
Out of curiosity @brianteeman @joeforjoomla what's your MySQL version ? |
8.0.19 MySQL Community Server - GPL |
My version is MySQL 5.7 |
To me the screenshot in the comment above doesn't look as if there was an SQL error. It shows the finalization step, and that would not be the case when an SQL error happened. To be sure: Which SQL statement is the last one logged in administrator/logs/joomla_update.php? |
@joeforjoomla Just to be sure: Do you use an .htaccess file in the Joomla root? If so, does it contain more things than the htaccess.txt shipped with Joomla? If so, does it contain a line like the following?
And it does not contain a line like the following?
If this is the case, then that's your problem, it cannot run the finalization step at all. Check https://docs.joomla.org/Htaccess_changes_after_joomla4.0.4 and https://www.joomla.org/announcements/release-news/5850-changes-to-update-process-that-you-need-to-be-aware-of.html for the details. It's just an idea, maybe I'm completely wrong here. |
@joeforjoomla Could you run the following SQL statement (replace
This statement should have been run during the update, but it seems that has not happened for some reason. To find out the reason I still need to know which was the last SQL statement reported in the update log of the failed update attempt. |
Potential fix: #36585 |
@richard67 not really the htaccess is not enabled at all |
@dgrammatiko @richard67 Yes that was the problem. Confirmed. |
@joeforjoomla please mark your test |
Solved with #36585 . |
Steps to reproduce the issue
Install 4.0.5
Upgrade to 4.1 package
Update the database:
Expected result
All is working
Actual result
CSS and assets are lost no longer loaded. It seems that they can't be found in the new 'media' folder but only under 'classic' templates folder.
The text was updated successfully, but these errors were encountered: