-
-
Notifications
You must be signed in to change notification settings - Fork 223
Add support for multiple template folders #1555
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
base: master
Are you sure you want to change the base?
Add support for multiple template folders #1555
Conversation
…if this implementation is correct
I don't have the know how yet on how to test this but on a glance at the code: The implementation seems to rely on adding 2 settings in the future:
I suggest only this:
To minimize regression while minimizing too much logic, options include:Don't worry about new user that want to revert to an older version.Create a getter for either templates_folder: or templates_folders: to continue handling the old settings? Migrate based off of version without destroying the dataImplement a method that checks the version and institutes a migration from You could even implement a reversion where it migrates back to templates_folder: "", but then your going many to one. I suggest not worrying about it. The legacy setting should be fine. This would remove the need to write logic for if enabled_multiple_folders everywhere. |
Just to confirm my understanding, your recommendation would be to:
You mentioned leaving the data for templates_folder alone to support legacy users, but I don't see how to do this without issues. There doesn't seem to be a way to set a default value for a setting (that is dependent on another setting's value). Instead, if we manually check if templates_folders is empty and copy the value from templates_folder, the migration would trigger each time the plugin is launched and templates_folders is empty (which would not be expected user behavior). Does this sound correct? Or do I have a misunderstanding somewhere? |
Why do we need to clear this? The only thing we need to check is if
I recommend using |
It doesn't need to be cleared. However, I think the only reason to keep it is to revert to a prior version and maintain data. Depending on when that happens, the user could have moved the templates folder. The setting would be stale. It could silently work in the case the user is pointing to a folder that exists but is no longer in use. Removing it would display a modal error in prior versions if the default templates folder doesn't exist. Removing it reduces ambiguity. |
Implements #1518