Yaron Koren has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/191590

Change subject: Fixed iteration through values for "dynamic table"
......................................................................

Fixed iteration through values for "dynamic table"

Change-Id: If251e979214cc19777ae15f488fdc8026a167753
---
M formats/CargoDynamicTableFormat.php
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/90/191590/1

diff --git a/formats/CargoDynamicTableFormat.php 
b/formats/CargoDynamicTableFormat.php
index f002b2d..6967cb8 100644
--- a/formats/CargoDynamicTableFormat.php
+++ b/formats/CargoDynamicTableFormat.php
@@ -58,8 +58,13 @@
 
                foreach ( $formattedValuesTable as $row ) {
                        $text .= "\t\t\t<tr>\n";
-                       foreach ( $row as $value ) {
-                               $text .= "\t\t\t\t<td>$value</td>\n";
+                       foreach ( array_keys( $fieldDescriptions ) as $field ) {
+                               if ( array_key_exists( $field, $row ) ) {
+                                       $value = $row[$field];
+                               } else {
+                                       $value = null;
+                               }
+                               $text .= "\t\t\t\t" . Html::rawElement( 'td', 
null, $value ); 
                        }
                        $text .= "\t\t\t</tr>\n";
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/191590
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If251e979214cc19777ae15f488fdc8026a167753
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to