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] Register App extensions also for Classes in Subfolders #11046

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from

Conversation

benatoff
Copy link

@benatoff benatoff commented Nov 3, 2024

In the current version of Statamic the App extensions - such as custom Modifiers, Scopes, Tags, Fieldtypes etc. - only auto register if they are directly in their respective folders but not if they are in a subfolder.

e.g.
app/scope/MyScope.php will register
app/scope/order/MyScope2.php will not register.

For order/organisational purposes this change would be preferred.

This PR doesn’t solve the Problem that two classes with the same Name in different namespaces receive the same handle and therefore overwrite each other but since that problem already exists between plugins and the handle can be customized with “protected static $handle” I wasn’t sure this problem needed solving.

Targets branch 5.x
Tests: I didn't find any test for the Serviceprovider and don't know the convention where to add onto. If it's required I'll try to add it.

Closes #11047.

@duncanmcclean duncanmcclean changed the title [5.x] register App extensions also for Classes in Subfolders [5.x] Register App extensions also for Classes in Subfolders Nov 4, 2024
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.

App Extension Classes (scopes, filetype etc.) don't register when in a subfolder
1 participant