jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/334494 )

Change subject: Allowing empty columns to have labels and descriptions
......................................................................


Allowing empty columns to have labels and descriptions

Bug: T155661
Change-Id: I1b5171d97b290552215272db3e72e1f1dfa93df0
---
M includes/content/CollaborationListContent.php
1 file changed, 12 insertions(+), 8 deletions(-)

Approvals:
  Harej: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 12253d6..cdfea78 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -734,12 +734,12 @@
        }
 
        private static function convertFromHumanEditableColumn( $column ) {
+               // Adding newline so that HUMAN_COLUMN_SPLIT2 correctly triggers
+               $column = $column . "\n";
+
                $columnItem = [ 'items' => [] ];
 
                $columnContent = explode( self::HUMAN_COLUMN_SPLIT2, $column );
-               if ( count( $columnContent ) == 1 ) {
-                       return $columnItem;
-               }
 
                $parts = explode( "|", $columnContent[0] );
 
@@ -775,11 +775,15 @@
                        }
                }
 
-               $listLines = explode( "\n", $columnContent[1] );
-               foreach ( $listLines as $line ) {
-                       // Skip empty lines
-                       if ( trim( $line ) !== '' ) {
-                               $columnItem['items'][] = 
self::convertFromHumanEditableItemLine( $line );
+               if ( count( $columnContent ) == 1 ) {
+                       return $columnItem;
+               } else {
+                       $listLines = explode( "\n", $columnContent[1] );
+                       foreach ( $listLines as $line ) {
+                               // Skip empty lines
+                               if ( trim( $line ) !== '' ) {
+                                       $columnItem['items'][] = 
self::convertFromHumanEditableItemLine( $line );
+                               }
                        }
                }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b5171d97b290552215272db3e72e1f1dfa93df0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej <jamesmh...@gmail.com>
Gerrit-Reviewer: Harej <jamesmh...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to