I’ve previously set up a multisite system where publications are published across different domains. Domains represent different sub organisations and (sometimes) have different locales, therefore I used the multisite: true flag. This allowed us to selectively publish publications to specific organizations.
Now, they want to ensure that if a publication is published for example in French, it will appear on all sites with FR as their locale. I know we can achieve this using the multisite: locale flag.
However, I’ve noticed that this only works for future publications, not for those previously saved. Manually opening and saving each publication individually does produce the desired result.
Is there a more efficient way to retroactively publish existing records based on their locale? Are there any console commands available for this purpose?
What are your views on this? Does anyone have any experience on this?
There is a tailor:propagate console command that can be used for this purpose. It will spin over every record and “save” it to produce any propagated records.
I’ve now added two new sites with locale nl and fr.
I’ve then run php artisan tailor:migrate.
The console tells me:
Propagating Blueprint Records
- Subspecialties: 20 record(s)
- Taskforces: 8 record(s)
- Practice Locations: 4 record(s)
But when I look at the Subspecialties Tailor records in the backend, they do not show up in the context of the new sites with locale FR and NL.
I have checked and they were correctly created previously in two other sites that had the locale FR and NL.
So keep in mind that the site previously had 3 subsites (locales EN, NL, FR), and now two have been added (NL, FR). I expected the NL and FR versions of my Tailor records to appear in the newly created sites after running php artisan tailor:propagate.
Final note: the previous NL and FR sites belonged to a different site group. Could that be the cause?
Check the database to see what is happening. Based on the output, it has done something and so there doesn’t look like there is anything for me to troubleshoot.
Using a small world example, if you can provide the following:
What is the expectation?
What is currently happening?
Potentially, its not propagating to newly introduced sites? Could that be it?
Thanks for your answer.
It looks like there is an issue with the multisite: locale; setting when sites have the same locale, but belong to a different site group.
I have two site groups.
Group A, with two locales:
NL
FR
Group B, with three locales:
EN
NL
FR
The two locales NL & FR have recently been added to Group B and did not exist before.
It was my expectation that if I would run the propagate command, that Tailor records with Blueprint setting multisite: locale; from Goup A (NL & FR) would show up in Group B (NL & FR).
This is not the case.
Moreover, it seems that manually saving a Tailor record from Group A NL to Group B NL is treated as a separate record, not another language version of the same record!
This causes major issues in our platform as we use these records to store information about users that now causes issues if the user switches between languages.
You can test this out by creating two site groups, and creating two sites with different locales in each group (2 locales across 4 sites in 2 groups) and trying to save a Tailor record from Group A locale 1 to Group B locale 1.
I’ve been scouring the database, but I honestly can’t seem to find any changes after running the propagate command. I hope I’m not overlooking anything, but I’ve gone through each table twice.