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] Fix issue with localization files named like handles #11482

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

ChristianPraiss
Copy link
Contributor

@ChristianPraiss ChristianPraiss commented Feb 21, 2025

We were encountering an issue placeholderLabel(): Argument #1 ($label) must be of type ?string, array given that appeared when there is a localization file that is named like a global set. Similar issues can appear with fieldsets. They are related to the way laravel localization works when a translation file is named like a translation key, e.g. __('search") and lang/en/search.php. In this case the whole contents of a file are returned instead of a string.

The underlying issue was already encountered and had been fixed for some parts of statamic 4, so I applied the same fix to the relevant files. https://github.com/statamic/cms/pull/9525/files

We were encountering an issue ’’’placeholderLabel(): Argument statamic#1 ($label) must be of type ?string, array given’’’ that appeared when there is a localization file that is named like a global set. Similar issues can appear with fieldsets. They are related to the way laravel localization works when a translation file is named like a translation key, e.g. __('search") and lang/en/search.php. In this case the whole contents of a file are returned instead of a string.

The underlying issue was already encountered and had been fixed for some parts of statamic 4, so I applied the same fix to the relevant files. https://github.com/statamic/cms/pull/9525/files
@jasonvarga jasonvarga merged commit b9b0fe8 into statamic:5.x Feb 21, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants