?
avatar sfs-it
sfs-it
15 Feb 2017

Steps to reproduce the issue

Remove a installed a package that support lang file, and pkg_script.php
on class pkg_XXX uninstall method will be called a JText::_('MESSAGE)
MESSAGE will not traslated

Expected result

Display, the correct MESSAGE translation (get from pkg_XXX.sys.ini)

Actual result

MESSAGE will not traslated

System information (as much as possible)

Joomla 3.6.5

Additional comments

i wrote this patch and committed on forum.joomla.org
https://forum.joomla.org/viewtopic.php?f=715&t=946981&p=3460994#p3460994

on line 722 of libraries/cms/installer/installer.php

                // Add the languages if installed with package
                if ($type === 'package')
                {
                    if ($this->extension->load($identifier,null))
                    {
                        $lang = JFactory::getLanguage();
                        $lang_tag = $lang->getTag();

                        if (!$lang->load($this->extension->element.'.sys',JPATH_SITE,$lang_tag))
                        {
                            $lang->load($this->extension->element.'.sys',JPATH_SITE);
                        }
                    }
                }

--
Agostino Zanutto
SFS.it

avatar sfs-it sfs-it - open - 15 Feb 2017
avatar joomla-cms-bot joomla-cms-bot - change - 15 Feb 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Feb 2017
avatar sfs-it sfs-it - edited - 15 Feb 2017
avatar sfs-it sfs-it - change - 15 Feb 2017
The description was changed
avatar sfs-it sfs-it - edited - 15 Feb 2017
avatar sfs-it sfs-it - change - 15 Feb 2017
The description was changed
avatar sfs-it sfs-it - edited - 15 Feb 2017
avatar Bakual
Bakual - comment - 15 Feb 2017

Since you already have code proposed, can you please make a PR so it can be reviewed and tested?
See https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests for some guidance how to create a PR

avatar joomla-cms-bot joomla-cms-bot - change - 15 Feb 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 15 Feb 2017
avatar sfs-it
sfs-it - comment - 15 Feb 2017

@Bakual Sorry it's my first time :D
Reading code of 3.7 on line 722 of the same file there is a comment that explain that "adapter" will translate language... and there isnt loaded.
https://github.com/joomla/joomla-cms/blob/3.7.x/libraries/cms/installer/installer.php#L722
Later I try to create a devel host 3.7 based and I'll see if the issue die on 3.6.5.

Have a good day.

avatar franz-wohlkoenig franz-wohlkoenig - change - 30 Mar 2017
Category Language & Strings
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Apr 2017

@infograf768 can you have a Look for a PR?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14087.

avatar joomla-cms-bot joomla-cms-bot - change - 5 Apr 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 5 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Apr 2017
Priority Medium Very low
Status New Confirmed
avatar infograf768
infograf768 - comment - 5 Apr 2017

I would need an extension which has such a script to test.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Apr 2017

@sfs-it do you have such an Extension?

avatar sfs-it
sfs-it - comment - 5 Apr 2017

@franz-wohlkoenig you fixed it on 3.6.5 or 3.7?
I can build an extension dedicated if you need for it.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Apr 2017

@sfs-it @infograf768 was asking for an Extension, guessing 3.7

avatar sfs-it
sfs-it - comment - 5 Apr 2017

Gimme 20' and I build one for testing.

avatar sfs-it
sfs-it - comment - 5 Apr 2017

@franz-wohlkoenig
I placed 2 empty install packages.
fist one is for a system plugin => https://www.sfs.it/downloads/J36-plg_system_testing_uninstall_demo.zip
second is a template => https://www.sfs.it/downloads/J36-tpl_testing_uninstall_demo.zip

both had all events enabled on script.php.

Template uninstall dont generate any script.php call on 3.6.5.

Attachments:
J36-plg_system_testing_uninstall_demo.zip
J36-tpl_testing_uninstall_demo.zip

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Apr 2017

@infograf768 can you please have a look above?

avatar infograf768
infograf768 - comment - 5 Apr 2017

I fail to understand the issue as well as the code proposed.

The proposed plugin (its type is NOT package but plugin) installs/uninstalls OK and the uninstall message displays OK, i.e., as I changed the string
PLG_SYSTEM_TESTING_UNINSTALL_DEMO_UNINSTALL_TEXT="Uninstallation went perfectly"
this without the patch.

It does not work for the template with or without patch, no message at all, but I guess this may be due to your code rather than core.

avatar mbabker
mbabker - comment - 5 Apr 2017

The template install adapter is only on the standardized install path. So install actions should trigger the scriptfile.

The uninstall path will be fixed in 4.0. Mainly because standardizing all of that for all of the adapters will most require B/C breaks in the system internals.

avatar sfs-it
sfs-it - comment - 5 Apr 2017

Sorry... I create pkg, gimme 10'

avatar sfs-it
sfs-it - comment - 5 Apr 2017

Here there are the pkg
J36-pkg_testing_uninstall_demo.zip

avatar infograf768
infograf768 - comment - 6 Apr 2017

@sfs-it

@mbabker has replied to you above:
#14087 (comment)

avatar sfs-it
sfs-it - comment - 6 Apr 2017

@mbabker what do you mean with "The template install adapter is only on the standardized install path. So install actions should trigger the scriptfile."
I've write an template and if I uninstall it, the class in script file arent call...

avatar mbabker
mbabker - comment - 6 Apr 2017

Right. The install path was standardized in 3.4. The uninstall path hasn't yet, and as such each extension adapter still has different behaviors.

avatar mbabker
mbabker - comment - 29 May 2017

#16343 is the starting point for standardizing things. It will only be 4.0 due to the required B/C breaks.

avatar brianteeman brianteeman - change - 29 May 2017
The description was changed
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2017-05-29 17:50:46
Closed_By brianteeman
avatar brianteeman brianteeman - close - 29 May 2017
avatar brianteeman
brianteeman - comment - 29 May 2017

Closed so we just have one place see #16343

Add a Comment

Login with GitHub to post a comment