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

[5.x]: Element select modals shows all site entries when switching to a site without any sources #14956

Closed
mmikkel opened this issue May 7, 2024 · 2 comments
Assignees
Labels

Comments

@mmikkel
Copy link
Contributor

mmikkel commented May 7, 2024

What happened?

Description

It looks like the fix for #14923 might have introduced (or exposed?) a different bug:

In element select modals, when switching to a site that has no sources, the element index will become populated with (as far as I can tell) every single entry in that site, including nested entries.

In the screencast below, I have a section called "Pages" that is only enabled for the site "Craft 5", and an entries field that has "Pages" as its only source. In the entry select modal for that entries field, I switch the site from "Craft 5" to "Another site" (which doesn't have the "Pages" section enabled and hence, no sources to display entries from). At that point, Craft outputs all entries from that site.

CleanShot.2024-05-07.at.22.12.02.mp4

The above behaviour does not occur if the entry select modal has the site without sources active when it opens – it specifically happens when using the site menu to switch to a site without sources:

CleanShot.2024-05-07.at.22.17.11.mp4

Steps to reproduce

  1. Create two sites, "Site A" and "Site B"
  2. Create a section "Foo" that is only enabled for Site A
  3. Create an entries field that has the "Foo" section as its only source. Enable the "Show site menu" setting.
  4. Add the entries field to a field layout and create an entry with that field layout, with "Site A" active.
  5. In that entry, click the "Add an entry" button in the entries field.
  6. In the entry select modal that appears, switch the site from "Site A" to "Site B"

Expected behavior

No entries should display for sites without any sources, which is the case in Craft 4.

(Ideally, I wish that element select modal site menus excluded sites without sources, but I'm aware that this has never been the case - maybe a FR 🙂).

Actual behavior

When switching to a site without sources, the element select modal lists all entries from that site.

Craft CMS version

5.1.2

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

None

@i-just
Copy link
Contributor

i-just commented May 8, 2024

Hi, thanks for reporting! I raised a PR for it. (BTW, it was not related to #14923.)

@brandonkelly
Copy link
Member

Craft 5.1.3 is out with a fix for this. Thanks again.

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

3 participants