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

[4.x] Fix templates fieldtype when views are in a non-default location #9085

Merged

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Nov 29, 2023

This pull request attempts to fix an issue where the Templates fieldtype (which lets you select the template/layout for a collection), wouldn't return any templates after the site's views were moved outside of resources/views.

This PR re-works how the fieldtype finds available views - doing away with the folder/disk stuff, which I assume was ported from v2, to using PHP's RecursiveDirectoryIterator.

This allows us to search any of the configured paths for views (which can be configured in a project's view config file) without needing to setup filesystems for each of them.

Happy for this PR to be re-worked if there's a better way of doing any of this.

Fixes #6643.

src/Fieldtypes/TemplateFolder.php Outdated Show resolved Hide resolved
@duncanmcclean duncanmcclean marked this pull request as draft November 29, 2023 18:23
@duncanmcclean duncanmcclean marked this pull request as ready for review December 1, 2023 15:20
@jasonvarga jasonvarga merged commit 765d30b into 4.x Dec 7, 2023
35 checks passed
@jasonvarga jasonvarga deleted the fix/hard-coded-resources-directory-in-templates-fieldtype branch December 7, 2023 19:17
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.

Templates don't show up in dropdown on Collection setting pages after renaming 'Views' directory
2 participants