? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
5 Mar 2020

Pull Request for Issue #28176 .

Currently, a content language is only automatically created when doing a fresh install of a language pack. When using the reinstall feature or the discover install one, it isn't created.

Summary of Changes

I've moved the code to create a content language into an own method in the class and calling that class new also from the discover_install and update path.
I also added a check so the language is only created if the content language doesn't already exist.

Testing Instructions

  • Install a language pack (eg German)
  • Check that the content language is created, then trash it and empty the trash.
  • Use the "Reinstall" button in the Install Language view to install the same language again
  • Check that the content language is created again, then again delete it.
  • Delete the entries for the language in the #__extensions table. It should be those with the highest ID if you installed it fresh
  • Try to discover install the language and check that the content language is yet again created.
  • Try to reinstall/discover install without deleting the content language and make sure you don't get multiple times the content language and also no error messages.

Expected result

Content language is created after each install/update/reinstall/discover_install

Actual result

Content language is only created during intial install

Documentation Changes Required

None

avatar Bakual Bakual - open - 5 Mar 2020
avatar Bakual Bakual - change - 5 Mar 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Mar 2020
Category Libraries
avatar astridx
astridx - comment - 6 Mar 2020

I have tested this item successfully on fb08f77


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

avatar astridx astridx - test_item - 6 Mar 2020 - Tested successfully
avatar astridx
astridx - comment - 6 Mar 2020

For the tests described above, I deleted the language using the Extension Manager. I found that the content language is not deleted (is that an error?). After the new installation of the language I got the message shown in the picture and the content language was actually not installed twice.

Extensions  Languages   test   Administration

avatar alikon
alikon - comment - 6 Mar 2020

maybe off-topic but meanwhile testing this pr switching from Languages: Content to Languages: Installed an viceversa was very annoying , maybe there should be a direct between the two
what do you think ?

avatar alikon
alikon - comment - 6 Mar 2020

I have tested this item successfully on fb08f77


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

avatar alikon alikon - test_item - 6 Mar 2020 - Tested successfully
avatar alikon alikon - change - 6 Mar 2020
Status Pending Ready to Commit
avatar alikon
alikon - comment - 6 Mar 2020

RTC


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

avatar wilsonge
wilsonge - comment - 6 Mar 2020

I found that the content language is not deleted (is that an error?)

It's not - it's by design - because of the ripple effect of items that are assigned to that content language

avatar wilsonge wilsonge - change - 6 Mar 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-03-06 10:36:27
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 6 Mar 2020
avatar wilsonge wilsonge - merge - 6 Mar 2020
avatar wilsonge
wilsonge - comment - 6 Mar 2020

Thanks!

avatar infograf768
infograf768 - comment - 6 Mar 2020

?

avatar Bakual
Bakual - comment - 6 Mar 2020

After the new installation of the language I got the message shown in the picture and the content language was actually not installed twice.

That actually shouldn't happen. The code should check if the content language already exists and only try to create when not. So if that error is reproducable, we should fix it.

avatar astridx
astridx - comment - 6 Mar 2020

@Bakual I think I have expressed myself misleadingly. The content language was already there. It is therefore correct that it has not been installed again.

avatar Bakual
Bakual - comment - 6 Mar 2020

Yep, but it shouldn't give you a notice about it. That part is wrong. It should silently skip it.

avatar infograf768
infograf768 - comment - 14 Apr 2020

@Bakual
Concerning the useless Notice, here are 2 possible solutions.
Which one do you prefer?

contentlang_notice2.diff.zip
contentlang_notice.diff.zip

avatar Bakual
Bakual - comment - 14 Apr 2020

contentlang_notice.diff.zip looks like the simplest approach to me.

avatar infograf768
infograf768 - comment - 14 Apr 2020

@Bakual
If we use that one, do we really need to keep

		// Check if content language already exists.
		if ($tableLanguage->load(array('lang_code' => $tag)))
		{
			return;
		}

or is simply this return not the code to use at all. It is confusing.

avatar infograf768
infograf768 - comment - 14 Apr 2020

Hmm, after some more tests, I can't reproduce anymore the Notice.

avatar Bakual
Bakual - comment - 14 Apr 2020

Ah true, we already have that code at the beginning. That's why I meant it should never show that notice to begin with.
I never saw it myself so I have no clue why it happend.

Add a Comment

Login with GitHub to post a comment