(a) Log into administrator back-end
(b) Install the French language
(c) Go to screen "Extensions: Manage" (System => Manage -> Extensions)
(d) Select the extension that has the Name as "French (fr-FR)", Location as "Site", and Type as "Language"
(e) Press the button "Uninstall"
Note:
French language has been used for illustration only. This behavior is exhibited in all the language packs.
The error message should contain the full name of the extension
The French (fr-FR) extension is part of a package which does not allow individual extensions to be uninstalled.
The Frenchfr-FR extension is part of a package which does not allow individual extensions to be uninstalled.
Notice that the spaces and parenthesis are removed from the extension name. You can notice this behavior in the following example as well.
Joomla! 4.0.4
This may not be applicable only to language packs. This behavior would be exhibited in any extension that is a part of a package where the tag
<blockChildUninstall>true</blockChildUninstall>
is available in the package's xml file.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
This comes from this code in the language adapter
->clean
the manifest name takes off the parenthesis and spaces.
No idea why the "cmd" filter is used here. Maybe we should use "string"? Or "html"?
IIRC the name is parsed by JText that's the reason why spaces are not allowed, normally a extension name is com_xxx and in the component ini you have a language string com_xxx="The XXX component" I would expect the same is true for language packages.
Thanks for looking into this.
FYI - The same behavior is exhibited in 3.10 as well.
IIRC the name is parsed by JText that's the reason why spaces are not allowed, normally a extension name is com_xxx and in the component ini you have a language string com_xxx="The XXX component" I would expect the same is true for language packages.
Languages names (for clients) are an exception. Indeed they pass through Text::_()
as all extensions when displayed in the Extensions Manager, but they should never be translated but always presented in English.
The best demonstration is English (en-GB) which in the db is presented in full. Package and clients.
The other languages package names are also saved in db in full. No clean
there but only the manifest name. Only the client languages are not.
Text::_()
is not used in the Installed languages view and it is fine. (Italiano is a wrong name. Should be Italian...)
Therefore, there is no reason to install client languages with cmd
.
I tested changing cmd
to string
and it now works fine.
$this->name = InputFilter::getInstance()->clean((string) $this->getManifest()->name, 'string');
Hmm, if we change the filter for the name and the names are stored in database after filtering, then after changing the filter to "string" the name will not match anymore to what is stored in database. So it would need to fix the values in database with values from the manifests for all extensions of whichever type when updating from a version without the change to a version with the change from a potential fix.
I do not think so.
I installed the French pack https://downloads.joomla.org/language-packs/translations-joomla4/downloads/joomla4-french/4-0-3-1
then I modified the LanguageAdapter to use 'string' and went to install languages: it proposed pack 4.0.4.1.
All went fine.
There is a good reason for that, the adapter does not check for equal names but only tag, type and client
// Update an entry to the extension table
$row = Table::getInstance('extension');
$eid = $row->find(array('element' => $this->tag, 'type' => 'language', 'client_id' => $clientId));
if ($eid)
{
$row->load($eid);
}
else
{
// Set the defaults
// There is no folder for language
$row->set('folder', '');
$row->set('enabled', 1);
$row->set('protected', 0);
$row->set('access', 0);
$row->set('client_id', $clientId);
$row->set('params', $this->parent->getParams());
}
$row->set('name', $this->name);
$this->name is taken from a bit above in the code. It is the new pack manifest:
// Get the language name
// Set the extensions name
$name = (string) $this->getManifest()->name;
$name = InputFilter::getInstance()->clean($name, 'string'); // which I just changed to `string`
$this->name = $name;
As for English it is already fine as English (en-GB) in the db.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-11-06 16:58:11 |
Closed_By | ⇒ | richard67 |
Pull request for Joomla 4 is #35981 .
@imanickam Please test. If you can test with both 3.10.x and 4.0.y, test #35980 , too . Thanks in advance.
Closing as having a pull request for each 3.10 and 4.0.
Confirmed.