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

Fix adapter priority for widget visibility #1425

Merged
merged 6 commits into from
Aug 15, 2019
Merged

Conversation

ramonski
Copy link
Contributor

Description of the issue/feature this PR addresses

This PR fixes an issue where a custom adapter with higher "sort" priority did not "win", because its returned visibility value was skipped.

Current behavior before PR

Default DateReceivedFieldVisibility adapter always took precedence over a custom adapter which returned the value "visible" for the "edit" state.

Desired behavior after PR is merged

Custom visibility adapter always takes precedence when its "sort" key is higher than the default adapter.

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

@xispa
Copy link
Member

xispa commented Aug 14, 2019

@ramonski note I added this commit: 168b8ee

I think this one, together with RegistryHiddenFieldsVisibility, were taking advantage of the conditional statement you've removed. Please check and will accept thereafer

Copy link
Member

@xispa xispa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@xispa xispa merged commit 7ee4da9 into master Aug 15, 2019
@xispa xispa deleted the fix-widgetvisibility-priority branch August 15, 2019 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants