IBX-11694: Corrected condition for DisableSiteRootCheckboxIfRootLocationListener #1896
IBX-11694: Corrected condition for DisableSiteRootCheckboxIfRootLocationListener #1896mateuszdebinski wants to merge 2 commits into5.0from
Conversation
|
@mateuszdebinski the PR's title says absolutely nothing about the fix itself, please adjust it to be more informative. 😉 |
After what changes? |
I assume it's upmerge from 4.6 to 5.0 that got changes wrong. @mateuszdebinski ? |
|
@Steveb-p this is 8 years old code, there was no changes to that statement that I can find, and even more this was resolving actual issue at that time. How the fix correspond to old behaviour? |
In v5.0, we've shortened this if statement to check the opposite of 4.6, so instead of:
It should be: but it's But the first part has been correctly changed, while the second part remains the same, which now causes incorrect operation. Old behaviour is correct, but incorrect we changed it when we moved code to v5.0 |
ViniTou
left a comment
There was a problem hiding this comment.
@mateuszdebinski
ah, now i get it, miss that change from !== to === in history, focused on second part only. Well, not sure why this change was made, anyway 👍, but for the future, that is thr description that should go into the PR.
alongosz
left a comment
There was a problem hiding this comment.
Looks like it's a functionality that could use a simple unit test IMHO
konradoboza
left a comment
There was a problem hiding this comment.
+1 but I agree with @alongosz. @mateuszdebinski please provide some unit test coverage.
|



Description:
In v5.0, we've shortened this if statement to check the opposite of 4.6, so instead of:
if (null !== $location && 1 >= $location->depth)It should be:
if (null === $location || 1 < $location->depth)But it's
if (null === $location || 1 >= $location->depth)The first part has been correctly changed, while the second part remains the same, which now causes incorrect operation.
Old behaviour is correct, but incorrect we changed it when we moved code to v5.0