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

after_show in DCATPlugin breaks custom theme #82

Closed
metaodi opened this issue Dec 20, 2016 · 1 comment
Closed

after_show in DCATPlugin breaks custom theme #82

metaodi opened this issue Dec 20, 2016 · 1 comment

Comments

@metaodi
Copy link
Member

metaodi commented Dec 20, 2016

I just traced a bug to the after_show method of the DCATPlugin.

I was not expecting, that the dcat plugin would do anything with my theme, but it ended up overriding the names of some attributes on the resources in my theme.

E.g. my theme relies on the existence of an attribute named res.rights, after activating the dcat plugin, this attribute is suddenly called res.Rights. (or res.download_url becomes res.Download URL)

I guess this is a convenience method to display the translated strings for all those that do not use a custom theme. But for those that do, this plugin might break it.

Is there a way to make this behavior optional or to put it in another plugin? What I now ended up doing is overriding the DCATPlugin, but I'm not sure if this is something everybody has to do, that is in a similar situation like me.

@amercader
Copy link
Member

This could definitely be wrapped in a config option switch (ckanext.dcat.translate_keys) that allowed to turn this behaviour off. Happy to take a PR for it @metaodi

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

No branches or pull requests

2 participants