? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
3 Aug 2018

Code error in #21357

Summary of Changes

Making sure we are in multilang before using forcedLanguage.
Changing the code to get the article language as $this->element['language'] is wrong in this case.

Testing Instructions

Create a multingual site with articles set to some languages and other set to All languages.
When using the new "New Menu Item" button, the modal presented should take into account the language of the article for the Menu item created.
For an article tagged to ALL languages the language for the menu item can be anything (no forcedLanguage).
But for an article tagged to a specific language, the menu item should also be tagged to the same language.
This is unrelated to the Menu, which can be set to ALL or any language.

Before patch

We can choose in the modal any language for the menu item.

After patch

When the article is not tagged to ALL, the new menu item is already tagged to the same language as the article and it can't be changed.
screen shot 2018-08-03 at 17 15 42

Documentation Changes Required

yes when doc is made for #21357

@bene-we

avatar infograf768 infograf768 - open - 3 Aug 2018
avatar infograf768 infograf768 - change - 3 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 3 Aug 2018
Category Administration com_content
avatar infograf768 infograf768 - change - 3 Aug 2018
Title
[4.0] Fix #21357 when multilnguage is implemented
[4.0] Fix #21357 when multilanguage is implemented
avatar infograf768 infograf768 - edited - 3 Aug 2018
avatar infograf768
infograf768 - comment - 3 Aug 2018

Note: I also think the language load can be simplified
from

$language = Factory::getLanguage();
				$language->load('com_menus', JPATH_ADMINISTRATOR, 'en-GB');
				$language->load('com_menus', JPATH_ADMINISTRATOR, $language->getDefault());
				$language->load('com_menus', JPATH_ADMINISTRATOR);

to simply

				// Load the language files
				$language = Factory::getLanguage();
				$language->load('com_menus', JPATH_ADMINISTRATOR, null, false, true);
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Aug 2018

test this Weekend now.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Aug 2018

After save new Article no Button "New Menu Item" is shown.

System information

  • Nightly Build 4.0.0-alpha5-dev
  • Multilingual Sample Data (French, German DE, Persian)
  • Template: Cassiopeia
  • macOS Sierra, 10.13.6
  • Firefox 61 (64-bit)

CloudAccess.net

  • PHP 7.1.15
  • MySQLi 5.7.18-cll-lve
avatar infograf768
infograf768 - comment - 4 Aug 2018

hmm. The new button stuff was created in #21357 2 days ago.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Aug 2018

#21357 is merged so the Button should show. Installed Nightly 2 Times, get as always the "AJAX-Error" at end of Update but not the Button.

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 4 Aug 2018 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Aug 2018

I have tested this item successfully on 9d562e5

Works as expected after new Installation of Nightly (not Update as before).


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

avatar bene-we
bene-we - comment - 4 Aug 2018

@infograf768 did not thougt about this, thank you
@franz-wohlkoenig many thanks for testing again

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Aug 2018

@bene-we thanks for your Work.

avatar infograf768
infograf768 - comment - 4 Aug 2018

@bene-we
Please set your test OK in https://issues.joomla.org/tracker/joomla-cms/21391 by using the blue button "Test this"

avatar infograf768
infograf768 - comment - 4 Aug 2018

Note: will create the new PR for lang load separately.

avatar bene-we bene-we - test_item - 6 Aug 2018 - Tested successfully
avatar bene-we
bene-we - comment - 6 Aug 2018

I have tested this item successfully on 9d562e5


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 6 Aug 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Aug 2018

Ready to Commit after two successful tests.

avatar wilsonge wilsonge - change - 6 Aug 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-08-06 08:51:23
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 6 Aug 2018
avatar wilsonge wilsonge - merge - 6 Aug 2018
avatar wilsonge
wilsonge - comment - 6 Aug 2018

Thanks JM!

Add a Comment

Login with GitHub to post a comment