7685f4d87807 — Eddie Barraco 5 years ago
Fix the csv transformer
2 files changed, 3 insertions(+), 3 deletions(-)

M src/Form/TagLabelFilterType.php
M src/Twig/AppExtension.php
M src/Form/TagLabelFilterType.php +2 -2
@@ 24,7 24,7 @@ class TagLabelFilterType extends Abstrac
             ->addModelTransformer(new CallbackTransformer(
                 function ($labels) {
                     if (is_array($labels)) {
-                        return implode(' ', $labels);
+                        return implode(', ', $labels);
                     }
 
                     return $labels;

          
@@ 34,7 34,7 @@ class TagLabelFilterType extends Abstrac
                         return [];
                     }
 
-                    $labels = str_getcsv($labelsAsString);
+                    $labels = str_getcsv($labelsAsString, ',', '"');
                     foreach ($labels as $key => $label) {
                         $labels[$key] = trim($label);
                     }

          
M src/Twig/AppExtension.php +1 -1
@@ 28,7 28,7 @@ class AppExtension extends AbstractExten
     {
         $labels = [];
         foreach ($article->tags as $tag) {
-            $labels[] = $tag->getCsvProofLabel();
+            $labels[] = $tag->getCsvProofLabel('"');
         }
 
         $form = $this->formFactory->create(TagLabelFilterType::class, [