Widget Visibility - Fix broken dropdowns after updating to 4.7#6600
Conversation
zinigor
left a comment
There was a problem hiding this comment.
Thanks for the great effort, I have added two comments, can you please address them?
There was a problem hiding this comment.
Can you please modify the condition to be Yoda-style 'post_type' ===. Also, let's add a comment before this condition that it's done for backwards compatibility in order to avoid errors when people have "Post Type" selected?
There was a problem hiding this comment.
I've added a comment and changed the condition to Yoda-style. Thank you!
There was a problem hiding this comment.
I'd say that the change below is not needed because this can only be false when major is post_type, and we have already cut that flow out with the previous condition. Let me know if I'm not seeing something.
There was a problem hiding this comment.
Do you think it will be better if we remove the first condition and leave this one? It may prevent similar issues in the future if there are such, while the first one will handle post_type only ( the second one seems more "global" ). I wasn't sure which one is better that's why added both.
There was a problem hiding this comment.
Yeah, makes sense, but I'd rather not have a huge wrapping condition like this, because we don't remove major rules that often. It has only happened once so far afaik.
There was a problem hiding this comment.
Makes sense, thanks for clarification 😄
325da5c to
c1a423e
Compare
|
👍 thanks! |
|
branch-4.7 175c260 |
Fixes #6596 #6595
Changes proposed in this Pull Request:
Since "Post Type" option has been removed in 4.7, there is an js error when you open the widget visibility after updating from 4.6 to 4.7. The
majorDatavariable is empty and it prevents other conditions to be shown. This PR adds a check that themajorrule is notpost_typeand additional check thatwidget_conditions_datahas the property, before we make anything.Testing instructions: