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

Allow to select entries from other sites in entry picker not working #84

Open
theresao opened this issue Dec 1, 2020 · 16 comments
Open
Assignees

Comments

@theresao
Copy link

theresao commented Dec 1, 2020

Follow up ticket to #72

After the fix from issue 72 I now have a dropdown with my multisites in the linkit entry picker.
When i select an other site in this dropdown, the select options (entries to choose from) do not change. So unfortunately it is still not possible to select entries from other multisites.

It would be great if you could check that again, thank you!

@fvaldes33
Copy link

fvaldes33 commented Dec 16, 2020

We are seeing the same issues. Below is the payload from the modal when I switch sites. Should be showing siteId 3.

{
	"context": "modal",
	"elementType": "craft\\elements\\Entry",
	"source": "*",
	"criteria": {
		"siteId": 1,
		"search": null,
		"offset": 0,
		"limit": 100,
		"status": null,
		"enabledForSite": null
	},
	"disabledElementIds": [35119],
	"viewState": {
		"mode": "table",
		"order": "postDate",
		"sort": "desc"
	},
	"paginated": 0
}

Looks like this pull request did not get merged in? 81

In that PR I see the removal of the siteId siteId: element.siteId ?? null, but still see it in 1.1.12.1

@ghost
Copy link

ghost commented Feb 8, 2021

Well, #72 fixed the dialog part. But our dev's also hit this roadblock; after saving the element just disappears.

fruitstudios\linkit\base\ElementLink.php:85 asks for the owner element siteId. Removing this will show the selected cross-site item.

However, the link model doesn't store the selected element's siteId. So linking to it is still not possible. Besides that, there is the consideration how the translation method should play in this.

Any thoughts on this @ben-callaway? Or is this out of scope as far as you are concerned?

@fvaldes33
Copy link

@renzo-s - We ran into the same thing. Ended up just using aliases inside regular URL links for now.

I can give it a shot if this ends up being out of scope for @ben-callaway. We have 4-5 different multisite installs all using this plugin.

@ghost
Copy link

ghost commented Feb 9, 2021

Okay.. I hacked it in. Mostly used the non-modern JS style of the rest of the package. I'll create a pull if everything tested well.

What I did was create a hidden field, as an extra param in the field. Added it to the base model of Link and created some JS to listen for element select changes. This assumes only one entry selection, which is not technically true for the element select field, but is for the LinkIt field.

Edit: Code change overview is silly now it's in my fork

I'm not a plugin author and going through this with the lack of documentation from Craft and Garnish is a real pain. Massive props for the original author and other plugin creators.

@fvaldes33
Copy link

@renzo-s - Thanks for this! I can pull your fork into one of my multisite projects to test. Prob later today. Keep you posted.

@ghost
Copy link

ghost commented Feb 16, 2021

Any notes on trying out the fork @fvaldes33? I created the pull request anyway. Seems good on this end.

@abryrath
Copy link

@renzo-s I am working with @fvaldes33 and I'm hoping to test this fork this morning. Will update soon

@abryrath
Copy link

@renzo-s I tested your fork and it is working for me on a multisite install

@ghost
Copy link

ghost commented Feb 16, 2021

Thats great news. Can you merge and release this once you give it the one over @ben-callaway?

@davidhellmann
Copy link

🤔 any updates here?

@belkin
Copy link

belkin commented May 25, 2021

We're having the same issue with multisite setup. After selecting entry from another site group and saving it, page refreshes but the field is empty. With working forks and PR can we get any info/update over this?

@iuscare
Copy link

iuscare commented Aug 10, 2021

We're having the same issues with multisites. Any updates, if the PR will be implemented?

@ThomasRitter75
Copy link

There is no movement in this since 2020. Will this at least be fixed in the Craft 4 version?

@JayBox325
Copy link

Just noticed that entries are un-selected when I am looking at an entry that is shared across multiple sites. I'd hope this would be fixed in CraftCMS3

@FrDH
Copy link

FrDH commented Sep 7, 2022

+1

@mnlmaier
Copy link

mnlmaier commented Jun 7, 2023

Hey @ben-callaway, any updates on this? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.