-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
add deprecation warnings in jbot for templates #7
Comments
Idea:
Having this in
If doing this in |
Added link to jbot issue: plone/plone.classicui#7
very cool, so we need to write something like this ZCML directive https://github.com/zopefoundation/z3c.jbot/blob/2.0/src/z3c/jbot/meta.zcml for the jbotDeprecated part. |
This can be used when you move templates and want an existing jbot override for the old template path to still work. Example: * You move `old_package/test.pt` to `new_package/test.pt`. * You register a dictionary with: `{"old_package.test.pt": "new_package.test.pt"}` * If a third party package has a template override `old_package.test.pt`, we display a warning that the package should use `new_package.test.pt`. * The override with the old name still works: instead of `new_package/test.pt`, the override is used. * Of course an override with the new name works as well. Sample warning for a template that is moved from plone.app.layout to plone.classicui: UserWarning: Template /Users/maurits/zeelandia/plone60/src/zeelandia.theme/src/zeelandia/theme/browser/overrides/plone.app.layout.viewlets.searchbox.pt deprecated, use plone.classicui.viewlets.searchbox.pt For background, see plone/plone.classicui#7
I have implemented my idea in a PR: I tried it out in a client project where I had an override for the searchbox viewlet.
This uses a branch of In some other package, you should add a jbot override with filename Two things should happen then:
The example might be bad: these layout templates might be perfectly fine to stay in But: this should work as a proof of concept for the idea. |
This can be used when you move templates and want an existing jbot override for the old template path to still work. Example: * You move `old_package/test.pt` to `new_package/test.pt`. * You register a dictionary with: `{"old_package.test.pt": "new_package.test.pt"}` * If a third party package has a template override `old_package.test.pt`, we display a warning that the package should use `new_package.test.pt`. * The override with the old name still works: instead of `new_package/test.pt`, the override is used. * Of course an override with the new name works as well. Sample warning for a template that is moved from plone.app.layout to plone.classicui: UserWarning: Template /Users/maurits/zeelandia/plone60/src/zeelandia.theme/src/zeelandia/theme/browser/overrides/plone.app.layout.viewlets.searchbox.pt deprecated, use plone.classicui.viewlets.searchbox.pt For background, see plone/plone.classicui#7
to move templates into plone.classicui, we need a way to show deprecation warnings, if someone is trying to override the template in the old path. It should still work, but show a message.
This needs to be build into jbot.
The text was updated successfully, but these errors were encountered: