[J4] Bug update from 4.0.0-rc5-dev to 4.0.0-rc6-dev
Message error:
"Not open server updates 3 (ID 0): https://update.joomla.org/core/extensions/com_joomlaupdate.xml" (translate from russia)
and
"3 arguments are required, 2 given"
But these errors occur when the control panel language is Russia.
And if the control panel language is set to English, then everything is updated well.
Labels |
Added:
?
|
That reads to me as if there were errors in the Russian language pack with some strings having not enough arguments for an sprintf.
But it was precisely because of this error that the update did not occur.
The sprintf error blocked the installation process.
But it was precisely because of this error that the update did not occur.
The sprintf error blocked the installation process.
Yes because as said the Russian language kit breaks it.
I could try to find the localization string with an error and give the correct translation. I need help with a hint on how to identify this localization parameter.
And the second problem is that it is necessary to fix the code so that in the future such errors in localization do not cause the update to stop.
An error was made in the localization, the correct localization will be in the next version, but due to the fact that the current error does not allow it to be updated to a new version with the correct localization. The error will never be fixed.
@korenevskiy Which version of the Russian language pack have you installed? Currently we have "Version 4.0.0-rc5.1" as latest version there https://downloads.joomla.org/language-packs/translations-joomla4/downloads/joomla4-russian . Maybe it just needs to update the language pack before updating the CMS?
The update manager is sacred, No localization error should interrupt it.
I downloaded the latest version from the link you provided https://downloads.joomla.org/language-packs/translations-joomla4/downloads/joomla4-russian
Installed localization -> Tried to update the Joomla update again ->
THE ERROR HAS BEEN REPEATED!
"3 arguments are required, 2 given"
A localization error should not disrupt update execution.
Well it was at least worth a try .. could you report this issue to the Russian translators in addition to here?
If you haven't tried yet with debug system switched on in global congihuration, and error reporting set to maximum, could you try again and see if you get a stack trace and if yes, post a screenshot here: That would save us some time to investigate the necessary fix.
I think I already have an idea where to start to search for the place where the error happens ... but as said, stack trace would help. I don't have the time now to test myself.
I repeat: A localization error should not cause the update process to stop. This is a problem of joomla itself.
@korenevskiy No need to repeat that all the time. We are not dump, and nobody has closed your issue, we are handling it.
sorry.
Repo of Russian localisation for J4 is here
https://github.com/JPathRu/localisation/tree/j4
I have already decided to start using Joomla 4 in production. In combat mode.
I have already decided to start using Joomla 4 in production. In combat mode.
@korenevskiy Not related to the problem here now .. but you remember that I have told you once that updating between nightly builds or development versions are not really supported, right? I'm almost 100% sure I did.
You should have used the official beta and now RC packages. I don't know since how long you are doing it like that. You can be lucky because in recent times there haven't been any changes on existing update SQL scripts so it worked well that way, but that was different in past in beta times and might have ended in incomplete database updates.
@richard67 Thanks for the advice, I have updated to RC5
:) Oddly enough, the error was repeated during the update.
@korenevskiy The error is probably related to JPathRu/localisation@733b9d3, which I fixed 2 days ago, but did not build a new package, since in my case it was just a warning and the update process was going well. Apply the fix and retry the update.
since in my case it was just a warning and the update process was going well
PHP 8 throws an error while previous PHP versions just returned false when too few arguments are passed to sprintf. Nothing that Joomla core can do here (from my point of view) [JOKE] but protecting any used PHP function from wrong parameters and so on [/JOKE]
So we need to fix it Text.php
wrap the sprintf()
error, and if an error occurs, return the localization parameter in the message.
From reading code in Text.php it seems we have the same issue in J3 and would have to do that at several places in the sprintf and the printf function.
To be honest I personally would be happier with an PHP error message like seen than with silently suppressng PHP errors in my code and outputting something just to output something. And unhappier to blow up the code with several checks just to do that. I would prefer to test and fix my extensions and all will be fine.
To be honest I personally would be happier with an PHP error message like seen than with silently suppressng PHP errors in my code and outputting something just to output something. And unhappier to blow up the code with several checks just to do that. I would prefer to test and fix my extensions and all will be fine.
So let's be honest.
Joomla should suppress errors in production (combat) mode. And only in the development mode, the error should be visible. Our customers, Joomla users should not suffer because of developer mistakes. Which cannot localize extensions. Very often extensions are localized through the Google translator, developers may not understand at all what the online translator has translated. The Google translator can separate the percent sign with a space, after which the number of parameters is lost automatically.
I suggest making 2 modes:
And even more so, many extensions will automatically issue an error. Because a lot of extensions written are written for PHP 7. We just saw this on a real example of how it happened with Joomla itself.
This means that this will automatically happen for a huge number of extensions in the JOOMLA(3/4) extension store.
It's a grave PHP error, not a Joomla error. PHP stops working, not Joomla. You must blow up the Joomla core code extremely to protect users from fatal PHP errors coming from extensions.
if (extension made nonsense with sprintf call)
{
- suppress PHP error message
- let extension live with a fatal PHP error so that it never get fixed
- make this for any other PHP standard function/method at any places in Joomla where it's used
}
@brianteeman opened already an issue that language packages should get a test suite or so to protect users from errors like above. I think that's the right way to keep core clean also with upcoming PHP versions.
Not exactly what I said but feel free to change my words to fit yours
It's a grave PHP error, not a Joomla error. PHP stops working, not Joomla. You must blow up the Joomla core code extremely to protect users from fatal PHP errors coming from extensions.
Your solution makes sense only if Joomla4 will have a minimum version of PHP8. But this is not so at all. Joomla4 is compatible with PHP 7.4.. Another sense is that such an extension check should have been done 1 year ago to say with confidence that J3 and J4 in PHP8 now do not hide errors and output as is. And then, without throwing an exception in SPRINF, it was clear to PHP developers that programmers completely ignore the return value of FALSE. So that programmers would not ignore such an error, so they introduced an Exception. But the appearance of an Exception does not mean that it should be shown to users. This means that programmers will not be able to ignore it. You wrote that it would be convenient for you personally to see the error as it is, of course it is obvious that you are a programmer and it is just convenient for you to see the error. But not all users like you are a programmer.
In Joomla, hiding fatal errors and enabling users to earn money is the right decision. Moreover, this is their problem, this CMS works on their personal virtual hosting, and not on yours. Moreover, such an error does not cause an extra load on the server.
Many users buy a website like in a store once, and then do not have the opportunity to repair it at all.
Our task is to help users earn money. And do not try to prevent them from making money because of the beauty of the code. The CMS itself is not needed in principle, if it will not help users but hinder them. The metaphor is this: No one needs a beautiful cake if they can't eat it. The beauty of the cake only complements its taste. The same thing happens with the CMS, the beauty of the code complements the CMS if the CMS allows you to earn money without costs.
`i write ugly code so....
I used the night build.
When trying to update, a fatal error falls out.
I have to switch the language every time.
.
From the contents of the error, I can see that the changes have already been made to the code. But after the changes, Joomla still cannot be updated.
For the user, the appearance of an error will block his ability to update, which means that it will block the opportunity for him to get an update without errors.
But this message is a "403 Access forbidden" which is normally a server error because it's not allowed to access a file or directory. And that goes away when you switch the language? Sounds weird.
Correction: As far as I understand the code J tries to pick the update package from the tmp/ directory but there is none or it's empty.
EDIT: The error message and 403 is misleading here I think.
Sorry, I don't know what happened. But now there is no access error. And there is just a fatal SPRINTF error when updating JOOMLA.
I downloaded the latest version from the link you provided https://downloads.joomla.org/language-packs/translations-joomla4/downloads/joomla4-russian
Maybe just a misunderstanding:
That's still the buggy version on the link above: ru-RU_joomla_lang_full_4.0.0-rc5v1
(checked today)
The corrected language pack for ru-Ru
hasn't been released yet.
Therefore: Please check the language string for placeholder COM_JOOMLAUPDATE_VIEW_UPLOAD_CAPTIVE_INTRO_BODY
in file administrator/language/ru-RU/com_joomlaupdate.ini
.
It must look like this and the string must contain only 1 %s
:
COM_JOOMLAUPDATE_VIEW_UPLOAD_CAPTIVE_INTRO_BODY="Пожалуйста, убедитесь, что пакет обновления загружен на <a href=\"https://downloads.joomla.org/latest\" target=\"_blank\" rel=\"noopener noreferrer\">официальной странице загрузки</a>. Перед началом процесса обновления подтвердите учетные данные администратора сайта <strong>%s</strong>."
This one is wrong. It contains 2 %s
:
COM_JOOMLAUPDATE_VIEW_UPLOAD_CAPTIVE_INTRO_BODY="Пожалуйста, убедитесь, что пакет обновления загружен на <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">официальной странице загрузки</a>. Перед началом процесса обновления подтвердите права администратора путем ввода логина и пароля для сайта <strong>%s</strong>."
For the sake of completeness: This is the english one with just 1 %s
:
COM_JOOMLAUPDATE_VIEW_UPLOAD_CAPTIVE_INTRO_BODY="Make sure that the update file you have uploaded comes from the official Joomla download page. Afterwards, please confirm that you want to install it by re-entering the login information for your site "%s" below."
The RC6 language pack has been released today, the problem should be resolved.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-08-11 11:02:45 |
Closed_By | ⇒ | zero-24 | |
Labels |
Added:
?
Removed: ? |
Ok closing for now thanks for the update @Kostelano
Ok closing for now thanks for the update @Kostelano
The CMS should be able to be updated even if there are errors in the translation.
But after correcting the translation error and closing this ISSUE, the CMS will not be able to update in case of a localization error.
@zero-24 @Kostelano
I updated joomla to 4.0.0.
Then in Russian, I tried to update again.
I couldn't update. The error is the same.
Errors haven't changed? Very strange. I have not seen the update error anywhere except from you.
UPD
I just installed the stable version of Joomla 4 on PHP 8, installed Russian, then downloaded the nightly build and updated to it. No problem!
I have updated the DEV version to stable. I switched to Russian. I tried to re-update the stable version updates.
I just upgraded to 4.0.2.
After that, I downloaded the "Joomla! 4.0.2 Upgrade Package (.zip)"separately.
In manual mode, I uploaded the package to the CMS. The error was repeated.
Do you have language overrides?
@korenevskiy, please write the exact environment (PHP, MySQL, etc) on which you get the error. Send any information that accompanies the error. Thanks.
It worked. Hooray.
But after all, the problem turns out to be left.
I clicked the green reinstall button.
After that, I re-installed the archive "Joomla! 4.0.2 Upgrade Package (.zip)".
But then, the problem is visible, that in the archive "Joomla! 4.0.2 Upgrade Package (.zip)" there is not an up-to-date version of the localization.
It worked. Hooray.
But after all, the problem turns out to be left.
I clicked the green reinstall button.
After that, I re-installed the archive "Joomla! 4.0.2 Upgrade Package (.zip)".
But then, the problem is visible, that in the archive "Joomla! 4.0.2 Upgrade Package (.zip)" there is not an up-to-date version of the localization.
I can't reproduce the problem already. There was an 8 version in PHP.
I had the same issue with Joomla 4.1.2 after reinstalling the current language extension it was fixed for me.
After a successful version update. I switched to Russian again and tried to update from the downloaded file
https://developer.joomla.org/nightlies/Joomla_4.0.0-rc6-dev-Development-Update_Package.zip
An error message:
"3 arguments are required, 2 given"