Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Multilingual status module improvements #27184

Merged

Conversation

infograf768
Copy link
Member

Replaces #24062 which had conflicts

This PR adds a Notice and displays the language concerned when the Content Language for that language has been deleted and remains in the site an orphan home page while the site language is published.
It also adds a Notice when a Content Language is in the trash.

It also reinstate all states of a content language to display the correct icons.
published = 1
published = 0
published = -2 (i.e. trash) and for this one displays the trash icon

It also modifies all the queries in the Helper to use quotename()

See more below

Testing Instructions

Install a multilingual site with all languages available to install
French fr-FR
German de-DE
Persian fa-IR

Then use the Cpanel Multilingual Sample Data module to create a basic.

First test:
Display the Content languages Manager
Trash AND delete the fa-IR Persian content language.

You should get this when displaying the multilingual status module

screen shot 2019-03-02 at 18 25 09

Then unpublish the French fr-FR Content Language.
And trash (do NOT delete) the German de-DE Content language.
I.e. Manager should look like this
screen shot 2019-03-02 at 18 28 10

You should get this when displaying the multilingual status module
screen shot 2019-03-02 at 18 44 18

Unpublish also the fr-FR Home page to get a new notice.
Deleted Content Language error now displays the notice as last.
see #24062 (comment)

Added new Notice when both Content Language and Home page are unpublished.
We should now get in that case:

screen shot 2019-03-03 at 10 22 15

Added notice when both content language and home page missing. added trash icon when home page is in the trash.

screen shot 2019-03-04 at 12 40 18

Added warning icon when home page does not exist.
screen shot 2019-03-04 at 12 56 37

Reminder

It is OK to have an Unpublished Content Language (as French is above) as it lets the site owner prepare a new Language for the multilingual site.

The screenshots were taken in March. They will now rather look like this:
Screen Shot 2019-11-30 at 08 44 07

@Quy
@alikon
Please test and specially look at the queries as I did my best but there could be improvements there.

@infograf768 infograf768 force-pushed the 4.0_multilingualstatus_improvements branch from 916bf77 to 2c59072 Compare December 1, 2019 08:42
@infograf768
Copy link
Member Author

infograf768 commented Dec 1, 2019

@Quy
Also did other combined queries, as much as I could do.
Could be missing some in the getStatus() method but I honestly think it would make the queries there more confusing than benefiting as we have multiple select.
Also I am not aware if we need or not to also change line 130 join and if we do as on line 123, if we should keep the ' AND ' as is.

May I suggest now to test the results of this PR rather than concentrating on the queries format as that type of format is absent from the majority of 4.0 code.

@infograf768 infograf768 force-pushed the 4.0_multilingualstatus_improvements branch from b36d13b to 81f786a Compare December 1, 2019 16:37
@infograf768
Copy link
Member Author

Done.

@joomla-cms-bot joomla-cms-bot added the Language Change This is for Translators label Dec 3, 2019
@Quy
Copy link
Contributor

Quy commented Dec 3, 2019

These are redundant.

The de-DE Content Language is trashed. It will not display on the site.

The Content Language de-DE is trashed.

@infograf768
Copy link
Member Author

These are redundant.

Good find! Corrected.

@infograf768 infograf768 force-pushed the 4.0_multilingualstatus_improvements branch from 84b30a6 to 83d41bc Compare December 9, 2019 08:16
@infograf768 infograf768 force-pushed the 4.0_multilingualstatus_improvements branch from 35a9bf9 to 93a6744 Compare December 10, 2019 07:35
@infograf768
Copy link
Member Author

Added a new Error when the Default Site Language has no published Content Language.
As this would totally break the site, It is displayed as an Error on top of other warnings.
To test, unpublish, trash or delete the Content Language related to the Site Default Language.
You should get this:

Screen Shot 2019-12-10 at 08 12 52

The second part of the new message "If not corrected, the multilingual feature will not work!"
could be improved. Proposals welcome!

@infograf768 infograf768 force-pushed the 4.0_multilingualstatus_improvements branch from c013afb to f861e02 Compare December 10, 2019 09:30
@infograf768
Copy link
Member Author

infograf768 commented Dec 10, 2019

Changed new string to
COM_LANGUAGES_MULTILANGSTATUS_ERROR_DEFAULT_CONTENT_LANGUAGE="The Content Language for the <strong>%s</strong> default Site Language is unpublished or does not exist. <strong>If not corrected, the multilingual feature may not function properly or the site may not be reachable!</strong>"

Screen Shot 2019-12-10 at 10 48 14

Thanks Mig.

I guess it is now ready to go, as a module.

@infograf768 infograf768 force-pushed the 4.0_multilingualstatus_improvements branch from 3788f28 to 84b1b58 Compare December 10, 2019 09:56
@imanickam
Copy link
Contributor

I have tested this item ✅ successfully on 605b87e


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

@infograf768 infograf768 force-pushed the 4.0_multilingualstatus_improvements branch from 605b87e to fb94651 Compare December 11, 2019 05:46
@Quy
Copy link
Contributor

Quy commented Dec 11, 2019

I have tested this item ✅ successfully on 0cc3ab8


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

@Quy
Copy link
Contributor

Quy commented Dec 11, 2019

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Dec 11, 2019
@HLeithner HLeithner merged commit efca0fb into joomla:4.0-dev Dec 12, 2019
@HLeithner
Copy link
Member

Thanks

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Dec 12, 2019
@HLeithner HLeithner added this to the Joomla 4.0 milestone Dec 12, 2019
@infograf768 infograf768 deleted the 4.0_multilingualstatus_improvements branch December 12, 2019 13:48
@infograf768
Copy link
Member Author

@brianteeman
I can make a new patch implementing what you wanted, with return when Close to the place where the Multilingual status was clicked.
multilang_full page

Is that what you want?

@brianteeman
Copy link
Contributor

That is almost what I was talking about - give me one sec

@brianteeman
Copy link
Contributor

The url would be
index.php?option=com_languages&view=multilangstatus&return=xxxxxxxxxxx

without the template=component so that it looks to be part of the site

image

@infograf768
Copy link
Member Author

infograf768 commented Dec 12, 2019

I will let you do it. I found some issues here doing it like this when switching to other menus without closing first the multilingual status module.

EDIT: also it lets click again on the module icon and we get into an endless loop as the redirect would now be the multilangstatus module path itself.

@infograf768
Copy link
Member Author

In any case the return is obtained by
$redirect = Uri::getInstance()->toString(); in the module default.php

@brianteeman
Copy link
Contributor

ok - I will put it on my todo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Change This is for Translators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants