[BUGFIX] Hide internal prefix "cat:" in tags of upgrade docs 47/58847/4
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 5 Nov 2018 19:28:52 +0000 (20:28 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 6 Nov 2018 18:20:54 +0000 (19:20 +0100)
The prefix "cat:" is used internally and it doesn't make sense to
show it to a regular user. Neither does it provide more output nor is
"cat" a regular word.

Resolves: #86858
Releases: master, 8.7
Change-Id: I8c48819814767c1ef4367c49da9ab3685081dceb
Reviewed-on: https://review.typo3.org/58847
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/install/Classes/UpgradeAnalysis/DocumentationFile.php
typo3/sysext/install/Tests/Unit/UpgradeAnalysis/DocumentationFileTest.php

index d3a930f..7821555 100644 (file)
@@ -128,9 +128,11 @@ class DocumentationFile
         $entry['filepath'] = $file;
         $entry['tags'] = $this->extractTags($lines);
         $entry['class'] = 'default';
-        foreach ($entry['tags'] as $tag) {
-            if (strpos($tag, 'cat:') !== false) {
-                $entry['class'] = strtolower(substr($tag, 4));
+        foreach ($entry['tags'] as $key => $tag) {
+            if (strpos($tag, 'cat:') === 0) {
+                $substr = substr($tag, 4);
+                $entry['class'] = strtolower($substr);
+                $entry['tags'][$key] = $substr;
             }
         }
         $entry['tagList'] = implode(',', $entry['tags']);
index dcaf3f8..05d5eaf 100644 (file)
@@ -166,7 +166,7 @@ class DocumentationFileTest extends UnitTestCase
     {
         $expected = [
             'unittest',
-            'cat:Important',
+            'Important',
         ];
         $result = $this->documentationFileService->findDocumentationFiles(vfsStream::url('root/Changelog/2.0'));
         $key = md5('vfs://root/Changelog/2.0/Important-98574-Issue.rst');