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]: Custom sources in entry indexes forget selected sites and cause errors #15406

Closed
MoritzLost opened this issue Jul 24, 2024 · 2 comments
Closed
Labels

Comments

@MoritzLost
Copy link
Contributor

What happened?

Description

Just ran into a curious issue. When editing a custom source on the entry indexes page, clicking on the settings for an existing custom source will 'forget' which sites were selected:

Screenshot 2024-07-24 at 17 56 41

The custom source is active for Site 1, but the checkbox is missing after opening and closing the settings modal.

Saving the modal with no sites selected for the custom will redirect and then throw an error, preventing you from changing this setting again:

array_map(): Argument #2 ($array) must be of type array, false given

Screenshot 2024-07-24 at 17 59 00

I had to hack a workaround into ElementSources::getSources() to be able to load the page again and fix the setting. Re-opening the custom source settings wipes the selected sites again.

Steps to reproduce

  1. Create a second site in the settings.
  2. In the entry index, create a custom source that is active in only one site and save the settings.
  3. Reopen the settings for the custom source and save it again.

Expected behavior

  • The custom source should not forget which sites are selected.
  • Having no sites selected should not result in an unrecoverable error.

Actual behavior

See above.

Craft CMS version

5.2.8

PHP version

8.3

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

@brandonkelly
Copy link
Member

Thanks for reporting that! Fixed for the next release.

@brandonkelly
Copy link
Member

Craft 5.2.9 is out now with that fix. 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

2 participants