[3.0] Drop the placeholders when flushing the board move stack - #9435
Open
albertlast wants to merge 1 commit into
Open
[3.0] Drop the placeholders when flushing the board move stack#9435albertlast wants to merge 1 commit into
albertlast wants to merge 1 commit into
Conversation
Moving a board offers one link per place it could go. While walking the tree the "after this board" link is held back on a stack until the board's children have been listed, and a board inside the subtree being moved has no links of its own, so null goes on the stack in its place just to keep the stack as deep as the tree. Popping already skips those. Flushing what is left at the end of the category did not, so the nulls reached the template and came out as: <a href="" class="move_links" title=""><span class="main_icons select_"></span></a> with two warnings behind them, since ManageBoards.template.php reads child_level off the first entry and href off each one. Moving a top-level board that has children is where it shows. On a forum whose last board is nested three deep, "Move" on the first board offered four destinations and three of them were these, leaving one real choice on the page. Signed-off-by: Mathias Alberts <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Admin → Boards and Categories → Move draws one link per place the board could go.
While walking the tree, the "after this board" link is held back on a stack until that
board's children have been listed. A board inside the subtree being moved has no links
of its own, so
nullgoes onto the stack in its place, purely to keep the stack as deepas the tree:
Popping already skips those (
if (($temp = array_pop($stack)) != null)). Flushing what isleft at the end of the category does not, so the placeholders go straight into
move_linksand reach the template:plus two warnings per placeholder, because
ManageBoards.template.phpreadschild_leveloff the first entry and
hrefoff each one:What it looks like
Moving a top-level board that has children is where it bites. On this tree:
"Move" on General Discussion offered four destinations, and three of them were the dead
links above — one real choice left on the page.
Checked
array_filter()on the stack before it is flushed. Everymove=on that tree, before andafter:
Every surviving link is the same one it was before — only the empty ones go. Then actually
moved a board through the UI to confirm the links still work, and the error log stayed
empty across the lot.
Issues References (Fixes|Related|Closes)
n/a