[New Feature] Multilingual: Propagating existing associations if desired #21321
Pull Request for Issue #21250
Summary of Changes
This adds a "Propagate" button in the Associations tab when editing a contact, category, article, menu item, newsfeed.
The button will display ONLY when there are more than 2 Content Languages defined for the site.
It is B/C as it will not break anything and one is totally free to choose or not to use the button, thus keeping the possibility to Clear/Select/Create any associations as before.
Using it prevents breaking existing associations when the wrong items are chosen for some fields.
A big thank you to Robbie Jackson for the long work to get this new functionality.
Create a Multilingual site with 3 or more languages.
Create a new item for each type, select another language than the ones which are already associated.
You will see, as usual (here for 4 Content Languages)
I do have already associations set for English and French.
I select for English the item which I know is associated.
The button displays (Better tip welcome)
Clicking on the button will give
Result: the already associated category in French is added in the French field.
If we have already associated all fields, clicking on Propagate will just display the message.
If we change an association in one of the fields and click Propagate, it is the associations from that language item that will be propagated and therefore replace the ones existing.
Documentation Changes Required
Testing this and my only issue is with the messages
The propagate button says
But you always get this message
The code should check to see if there any associations to propagate and if not then the message should be
And if there are associations to propagate then the message should be
We will now get 3 types of messages:
JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME will also display the language(s) where associations have been added.