-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
BUGFIX: Show and apply all changes in workspace review #4588
Conversation
- Fix assignment of `siteNode` - Fix path generation to fix grouping of changes by document - Fix publishing of deleted node - Fix checkbox behaviour to not publish new child nodes independent of parent Relates: #4573
While testing this change in our project we found that: Selecting all nodes by using "Select all current changes" and click on " Publish selected changes to live" (Calls Selecting nothing and click on " Publish all changes to live" (Calls
Edit: ... sometimes 🤯 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As written on Slack, I found it hard to review this PR because it contains unrelated changes (it seems).
Also without any tests it's hard to tell what changes actually fix the bug. Maybe you could add some inline comments (in code or just as PR comments) to explain the fix?
} | ||
} | ||
|
||
// Neither $documentNode, $siteNode or its cannot really be null, this is just for type checks; | ||
// We should probably throw an exception though | ||
if ($documentNode !== null && $siteNode !== null && $siteNode->nodeName) { | ||
$siteNodeName = $siteNode->nodeName->value; | ||
$documentPath = implode('/', array_slice(array_map( | ||
$documentPath = implode('/', array_reverse(array_map( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to understand: (how) is this related to the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In both places I didn't quite understand why we need the paths in the first place. It's also used by the current JS logic to select and group nodes by document. And in neos 8 that starts at the side node and not with the lowest node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And in neos 8 that starts at the side node and not with the lowest node
So that's why we change array_slice
to array_reverse
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
$relativePath = str_replace( | ||
sprintf('//%s/%s', $siteNodeName, $documentPath), | ||
'', | ||
implode('/', array_map( | ||
implode('/', array_reverse(array_map( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
Thx for your questions ❤️ I added some comments in the code as I think we might need them there for a future refactoring. |
We can update this to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx @mhsdesign for merging ❤️. So I think we should be good to go here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a bit hard to review (by reading). But we agreed to go for it as it definitely make things better!
Thanks for taking care!
Fixes: #4587
Relates: #4563
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions