Unverified Commit 2d2d397f authored by bkosborne's avatar bkosborne Committed by markcarver

Issue #2999011 by bkosborne, markcarver: PHP 7 - Warning: count(): Parameter...

Issue #2999011 by bkosborne, markcarver: PHP 7 - Warning: count(): Parameter must be an array or an object that implements Countable in bootstrap_table() line 238
parent c050d1d6
......@@ -101,7 +101,7 @@ function bootstrap_table(array $variables) {
}
// Format the table columns:
if (count($colgroups)) {
if (!empty($colgroups)) {
foreach ($colgroups as $number => $colgroup) {
$attributes = array();
......@@ -136,7 +136,7 @@ function bootstrap_table(array $variables) {
}
// Add the 'empty' row message if available.
if (!count($rows) && $empty) {
if (empty($rows) && !empty($empty)) {
$header_count = 0;
foreach ($header as $header_cell) {
if (is_array($header_cell)) {
......@@ -156,7 +156,7 @@ function bootstrap_table(array $variables) {
}
// Format the table header:
if (count($header)) {
if (!empty($header)) {
$ts = tablesort_init($header);
// HTML requires that the thead tag has tr tags in it followed by tbody
// tags. Using ternary operator to check and see if we have any rows.
......@@ -174,7 +174,7 @@ function bootstrap_table(array $variables) {
}
// Format the table rows:
if (count($rows)) {
if (!empty($rows)) {
$output .= "<tbody>\n";
foreach ($rows as $row) {
// Check if we're dealing with a simple or complex row.
......@@ -205,7 +205,7 @@ function bootstrap_table(array $variables) {
}
// Format the table footer:
if (count($footer)) {
if (!empty($footer)) {
$output .= "<tfoot>\n";
foreach ($footer as $row) {
// Check if we're dealing with a simple or complex row.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment