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
[6.0] Add a global master language for Multilingual Associations #25403
base: 6.0-dev
Are you sure you want to change the base?
[6.0] Add a global master language for Multilingual Associations #25403
Conversation
Since this list view is the only one in which an empty table is displayed before the user specifies what he wants to see via the select boxes, a preselection is defined by "default-values". The default language is set with the default site language, because normally the translations start from this language.
Since the selectboxes now always have a value, the buttons Delete associations and delete orphans of the toolbar are now always displayed. The "delete associations"-button now only deletes associations in which the user is currently located. - In addition, the button was adapted to a Confirm button, so that the associated js file and the associated message text could be removed. - The context is now also included as info in the message text.
- picked code from Wang-Yu-Chao/gsoc18_automatic_multilingual_association@55d46a1 -- remove column "Not Associated" from table -- removed now unused string -- removed parameter from function, as it is useless now --- remove all code using this parameter -- change color of the language-links --- grey (secondary) for not associated items --- green (success) for associated items
This add two fields for setting a masterlanguage in the languagefilter plugin. To set these parameters correctly there has been added an onExtensionAfterSave event, because these parameters depends on others.
The master item is the one written in the language of the global master language. - New Column 'parent_id' for saving relationsship of items of an association. If an association contains no items with the masterlanguage (it may be not used) the value is -1. If an association contains an item with the masterlanguage, this is now the parent and is set with 0. The other items of this association get the id of the master item / parent. - Add new method to get the global master language parameter. - Change save-methods for the associations table concidering the new column - Add methods to change the master item in the associations table after saving the Languagefilter Plugin. - set global master language parameters in multi sample data
After the colors in the association view have changed after the columns have been merged, they are now adjusted for the other lists. In addition, the association column has been centered in each list.
If a global master language has been set, it is displayed as info in the Language select box , so that it is recognizable which master language has been set.
In order to display the Master-Child relationship of the associations in the lists, the layout was adapted. So now all children of an association are displayed, if the item in the row is a master item. Otherwise, only the current child-item is displayed with its master item, since there is no direct relationship between the children. In addition, the links of the association items in the Associations View have been adjusted so that the reference is now oriented to the master item and target to the children.
…al-Associations-2
This adds a new column "assocParams" to the association table where the modified date of the master item is stored. The column for the master item always gets its latest modified date, its children get the modified date when the association is created. The table of menu items does not yet have a modified date, so the column remains empty. Also, a new AssociationsHelperClass is added for all Masterlanguage matters.
Adding this filter allows to quickly determine if a master element is associated or not and if child elements are either associated, not associated or obsolete.
Set parent id correctly if no master item is present.
To prevent associations from receiving the same association key, since id and language can be the same in different contexts, the context is also added as differentiation.
As described in WCAG 3.3.2: 'Labels or instructions are provided when content requires user input. (Level A)'
Remove the fieldset for the master language and position its fields after the item association field, as the master fields depend on it.
…al-Associations-3
Filtering for "not associated" did not work correctly when either a child of a master item is not associated or when there is no master item for a child.
…al-Associations-4
*/ | ||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
* @package Joomla.Administrator | ||
* @subpackage com_contenthistory | ||
* | ||
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
* @package Joomla.Plugin | ||
* @subpackage System.languagefilter | ||
* | ||
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
/** | ||
* Content Site Languages Field class. | ||
* | ||
* @since 4.0 |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
* | ||
* @var string | ||
* | ||
* @since 4.0 |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
* | ||
* @return array The field option objects. | ||
* | ||
* @since 4.0 |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
* | ||
* @return void | ||
* | ||
* @since 4.0.0 |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
* | ||
* @return void | ||
* | ||
* @since 4.0.0 |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
* | ||
* @throws Exception | ||
* | ||
* @since 4.0.0 |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Sorry that it took so long to respond. This has a big potential it would be a nice addition for Joomla. Unfortunately it never came out of the draft state and has currently a lot of conflicts, so I'm going to close this. If you are willing to drive it further, please fix the conflicts and rebase it to the 4.2-dev branch so we can help you get it into a testable state. Thanks for your help making Joomla better. |
As mentioned, it's a feature which is useful and if possible should make it into the core. So to not lose it between thousands of closed PRs, it should stay as a draft for a future rework. |
This pull request has automatically rebased to 4.2-dev. |
This pull request has been automatically rebased to 5.1-dev. |
Hi guys, |
This adds an optional global master language for the multilingual associations. The topic that had its beginnings in the two PR's #17881 and #17802 was tackled from scratch.
This gives each association a "Master-Child" relationship. This means that an associated item set with the master language is set as master and the items in the other languages are set as children.
This makes it possible to add new association statuses to the already existing 'not associated' and 'associated' ones: the 'outdated' and 'up-to-date' status. These new statuses maintain the child elements in relation to their master.
When associations are created, the children are given up-to-date status. If the master item is changed, the children will be set to outdated (if they were up-to-date until then). A distinction is made between whether the content history is enabled or not. The difference: content history only saves entries in which changes are really made.
In the Associations List View a new filter for the Association States has been added.
To update an outdated child to up-to-date a new edit view is called, in which it is only possible to save and update the target (i.e. the outdated child).
Here, too, a distinction is made between whether the content history is activated or not. If content history is activated, a customized Compare View of contenthistory is displayed. The changes of the master are displayed since the moment the child was set to outdated and to the current master.
If it is content history disabled, the normal edit view of the reference/master is displayed. The user has to determine whether there are changes to the master or not. Advantage over before: by the status outdated you at least know that someone has saved the master.
Summary of Changes
To prevent associations from receiving the same association key, since id and language can be the same in different contexts, the context is also added as differentiation.
As the bug appears only after my new queries (key query only), this is fixed here.
Testing Instructions
No empty list appears in the Associations List View and the delete buttons are now always displayed.
Go back to the Associations List View. A new filter appears and the associations are displayed differently, also in other List Views with associations.
Update a child element.
Expected result
Associations List View without a global Master Language:
Articles List View without a global Master Language:
Set a global Master Language in the Languagefilter Plugin:
Associations List View with Global Master Language:
Articles List View with Global Master Language:
New Update/Edit View for outdated items with versions enabled:
Actual result
Documentation Changes Required
Yes