Skip to content

Commit

Permalink
Fix My View Page missing boxes
Browse files Browse the repository at this point in the history
When displaying boxes on 2 columns (i.e. when Timeline is not shown),
the code handling the display of boxes failed to print the first box
after starting the 2nd column.

This commit simplifies the logic, only handling the closing of first
column's div and opening of 2nd column, and always printing the box
regardless of status.

It also removes dead code: the elseif to close the div at end of 2nd
column was never called, the div is actually closed after the foreach
loop ends.

Fixes #22104
  • Loading branch information
dregad committed Apr 11, 2019
1 parent 745e4f7 commit a239f82
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions my_view_page.php
Expand Up @@ -112,7 +112,6 @@
$t_number_of_boxes = count ( $t_boxes );
$t_boxes_position = config_get( 'my_view_boxes_fixed_position' );
$t_counter = 0;
$t_two_columns_applied = false;

define( 'MY_VIEW_INC_ALLOW', true );

Expand Down Expand Up @@ -141,22 +140,16 @@
}
# display the box
else {
if( !$t_timeline_view_threshold_access ) {
if ($t_counter >= $t_number_of_boxes / 2 && !$t_two_columns_applied) {
echo '</div>';
echo '<div class="col-xs-12 col-md-6">';
$t_two_columns_applied = true;
} elseif ($t_counter >= $t_number_of_boxes && $t_two_columns_applied) {
echo '</div>';
} else {
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
echo '<div class="space-10"></div>';
}
$t_counter++;
} else {
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
echo '<div class="space-10"></div>';
# If timeline is OFF, display boxes on 2 columns
if( !$t_timeline_view_threshold_access
&& $t_counter++ >= $t_number_of_boxes / 2
) {
# End of 1st column
echo '</div>';
echo '<div class="col-xs-12 col-md-6">';
}
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
echo '<div class="space-10"></div>';
}
}
?>
Expand Down

0 comments on commit a239f82

Please sign in to comment.