? Success

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
8 May 2016

This is the implementation of the alternative approach to #9999 I suggested.

To be quite frank, I don't work with the multilingual system so I don't know if this will have unintended side effects, someone more familiar than me on that will need to guide on this.

In essence, instead of importing the languagefilter plugin (which seems to hardcode it as the first plugin to be executed because the event dispatcher doesn't have an internal handling for event priorities), the plugin data is only loaded from the database and the params extracted out to set the application vars.

This defers importing of the plugin until the point when the system plugin group is imported to trigger the onAfterInitialise event and should cause the configured plugin ordering to be respected when importing and dispatching events.

avatar mbabker mbabker - open - 8 May 2016
avatar mbabker mbabker - change - 8 May 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 May 2016
Labels Added: ?
avatar andrepereiradasilva
andrepereiradasilva - comment - 8 May 2016

IIRC of that part is used to define the user language, and we need the language filter plugin params to calculate that.

@infograf768 please check

avatar mbabker
mbabker - comment - 8 May 2016

That's why I'm importing the plugin's params without loading the plugin to the event dispatcher basically. It's still a big stinking pile of crap keeping a hardcoded dependency to the plugin, but it ultimately fixes a deeper issue in the order that observers are attached to the event dispatcher which is what Soren is trying to work around.

avatar andrepereiradasilva
andrepereiradasilva - comment - 8 May 2016

yes i understand that.
i will test this when i have time.

avatar brianteeman brianteeman - change - 8 May 2016
Category Multilanguage Plugins
avatar brianteeman brianteeman - change - 8 May 2016
Category Multilanguage Plugins Libraries Multilanguage Plugins
avatar andrepereiradasilva andrepereiradasilva - test_item - 8 May 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 8 May 2016

I have tested this item :white_check_mark: successfully on d939290

Applied the patch and tested in a multilanguage sample site (3 languages):

  • Fallback with no cookie to site default language (system language filter plugin option)
  • Fallback with no cookie to browser default language (system language filter plugin option)
  • Use language cookie if exists
  • Language associations
  • Language routing

All worked with no issues


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

avatar mbabker
mbabker - comment - 13 Jun 2016

@aDaneInSpain This was in response to your issue...

avatar aDaneInSpain
aDaneInSpain - comment - 14 Jun 2016

Yes, looks good. Will get it tested ASAP. @vistiyos

avatar vistiyos
vistiyos - comment - 14 Jun 2016

@mbabker Thank you for your approach but I think this will not solve the issue we are having. I would like to know if remove that hard core dependency of "languagefilter" plugin. Maybe some changes is need in several places, so I would love to get some advice from the people that know how this plugin works.

avatar mbabker
mbabker - comment - 14 Jun 2016

@vistiyos without moving the language filter plugin's parameters to either a component or the global configuration, there is no way to 100% decouple the site application from the plugin. Moving the params IMO is more hassle than it's worth (it's a B/C break moving the param from one source to another as now code using the plugin params would have to be updated to use a new source).

This change should resolve the underlying issue of how the plugin is imported into the event dispatcher which causes it to always be the first plugin called when an event is dispatched, regardless of the ordering configuration you have set.

#9999 is one possible fix to this issue but the "flaw" with it is that it is importing everything into the event dispatcher immediately. This PR explicitly is only loading the plugin's parameters (and inherently the plugin data into the static container in JPluginHelper); this PR makes an explicit change to NOT push the plugin to the event dispatcher.

avatar vistiyos
vistiyos - comment - 14 Jun 2016

I have tested this item successfully on d939290

Applied the patch and tested in a multilanguage sample site (2 languages):

Fallback with no cookie to site default language (system language filter plugin option)
Fallback with no cookie to browser default language (system language filter plugin option)
Use language cookie if exists
Language associations
Language routing
All worked with no issues

avatar vistiyos
vistiyos - comment - 14 Jun 2016

@mbabker Thank you so much for you help and your PR.

Looking forward to see it merge on the new release of Joomla!.

avatar roland-d roland-d - alter_testresult - 24 Jun 2016 - vistiyos: Tested successfully
avatar roland-d roland-d - change - 24 Jun 2016
Status Pending Ready to Commit
avatar roland-d roland-d - change - 24 Jun 2016
Milestone Added:
avatar andrepereiradasilva
andrepereiradasilva - comment - 4 Jul 2016

Can we have a RTC here?

avatar joomla-cms-bot joomla-cms-bot - change - 4 Jul 2016
Labels Added: ?
avatar andrepereiradasilva
andrepereiradasilva - comment - 4 Jul 2016

ok we have it now ?

avatar roland-d roland-d - close - 16 Jul 2016
avatar roland-d roland-d - merge - 16 Jul 2016
avatar joomla-cms-bot joomla-cms-bot - close - 16 Jul 2016
avatar roland-d roland-d - reference | afead45 - 16 Jul 16
avatar roland-d roland-d - merge - 16 Jul 2016
avatar roland-d roland-d - close - 16 Jul 2016
avatar roland-d roland-d - change - 16 Jul 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-07-16 06:06:46
Closed_By roland-d
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jul 2016
Labels Removed: ?
avatar mbabker mbabker - head_ref_deleted - 16 Jul 2016
avatar infograf768
infograf768 - comment - 17 Jul 2016

@mbabker
This has broken multilang here
See #11161

avatar mbabker
mbabker - comment - 17 Jul 2016

Are you testing with both this patch merged plus that patch applied? If anyone is testing with only the changes to the language filter plugin applied then of course it would be broken because they are missing the changes to the application class.

If this is really causing issues I'm going to say someone else devise a patch to fix Soren's original issue because I don't get the language system enough to deal with this type of stuff. I just fixed what was a logical workflow issue.

avatar infograf768
infograf768 - comment - 17 Jul 2016

i tested indeed with both.

avatar mbabker
mbabker - comment - 17 Jul 2016

Then either the plugin parameters aren't being correctly loaded in the application class or some other change has caused this to misbehave. In either case, I don't have the knowledge of how the language system works to make any further corrections, so if you want to revert it go ahead.

avatar aDaneInSpain
aDaneInSpain - comment - 18 Jul 2016

If this is reverted we need to re-open #9999

avatar andrepereiradasilva
andrepereiradasilva - comment - 18 Jul 2016

no need to revert it. i think it's ok now. please confirm @infograf768

avatar infograf768
infograf768 - comment - 20 Jul 2016

yep

Add a Comment

Login with GitHub to post a comment