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

Maps not propagating #141

Closed
Tam opened this issue Mar 26, 2019 · 5 comments
Closed

Maps not propagating #141

Tam opened this issue Mar 26, 2019 · 5 comments
Labels

Comments

@Tam
Copy link
Member

Tam commented Mar 26, 2019

Maps don't propagate across sites.

@vandres
Copy link

vandres commented Apr 1, 2019

Just as a comment: The Map field should respect "translation method"

@peteeveleigh
Copy link

Can confirm. The field will work on the default site but doesn't seem to work on entries for other sites in a multi site setup.

@Antimated
Copy link

Any updates on when this will be fixed? :)

@stefangallas
Copy link

For a new project I came across the same bug. I would look forward to a bugfix, too. On the other hand, I have implemented a temporary workaround by adding the SiteId, under which the entries were originally entered, for the affected entry query .

@mmikkel
Copy link

mmikkel commented Jun 24, 2019

I started on a PR to fix this issue, but it proved too time-consuming. I did implement a working hotfix though – Maps are implemented as a custom Element type, so by listening to the Elements::EVENT_AFTER_SAVE_ELEMENT it's possible to "manually" propagate a Map being saved to all other supported sites.

Here's the code – this should be added to a custom Craft module or plugin. I can't promise that it's airtight, but it's working well on my end, for the moment.

Note that the hotfix a) will always propagate the Map field value across sites for new elements, and b) does not account for all the different translation methods; simply whether the field is set to "Not translatable" (any changes to the field will also be propagated across sites) or not (the field will only be propagated when the element is first saved, not for any further changes to the field).

@Tam Tam closed this as completed in f17a4cd Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants