[TASK] Hide word count in indexed_search backend if mysql fulltext is used 31/51931/2
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 2 Mar 2017 20:19:58 +0000 (21:19 +0100)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Mon, 6 Mar 2017 16:32:01 +0000 (17:32 +0100)
If mysql fulltext is enabled, the word count is always empty.
Therefore the word count should be always be hidden.

Resolves: #79985
Releases: master
Change-Id: I6463acecbb8935cf51419c5faebd9818da6efc7b
Reviewed-on: https://review.typo3.org/51931
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php
typo3/sysext/indexed_search/Resources/Private/Templates/Administration/Pages.html
typo3/sysext/indexed_search/Resources/Private/Templates/Administration/Statistic.html

index 56a4b89..603db69 100644 (file)
@@ -95,6 +95,7 @@ class AdministrationController extends ActionController
             }
             $this->generateMenu();
             $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
+            $view->assign('extensionConfiguration', $this->indexerConfig);
         }
     }
 
index 81179a0..4a1c194 100644 (file)
@@ -11,7 +11,9 @@
                                        <th><f:translate key="field.id"/>/<f:translate key="field.type"/></th>
                                        <th><f:translate key="field.title"/></th>
                                        <th><f:translate key="field.fileSize"/></th>
-                                       <th><f:translate key="field.wordCount"/></th>
+                                       <f:if condition="{extensionConfiguration.useMysqlFulltext} == false">
+                                               <th><f:translate key="field.wordCount"/></th>
+                                       </f:if>
                                        <th><f:translate key="field.mtime"/></th>
                                        <th><f:translate key="field.indexed"/></th>
                                        <th><f:translate key="field.updated"/></th>
@@ -37,7 +39,9 @@
                                        <td>
                                                <f:format.bytes decimals="1">{data.item_size}</f:format.bytes>
                                        </td>
-                                       <td>{data.numberOfWords}</td>
+                                       <f:if condition="{extensionConfiguration.useMysqlFulltext} == false">
+                                               <td>{data.numberOfWords}</td>
+                                       </f:if>
                                        <td>
                                                <is:format.dateTime>{data.item_mtime}</is:format.dateTime>
                                        </td>
@@ -69,4 +73,4 @@
                        </tbody>
                </table>
        </f:if>
-</f:section>
\ No newline at end of file
+</f:section>
index e5da39b..9dd727b 100644 (file)
                                                                <th>
                                                                        <f:translate key="field.content" />
                                                                </th>
-                                                               <th>
-                                                                       <f:translate key="field.words" />
-                                                               </th>
+                                                               <f:if condition="{extensionConfiguration.useMysqlFulltext} == false">
+                                                                       <th>
+                                                                               <f:translate key="field.words" />
+                                                                       </th>
+                                                               </f:if>
                                                        </f:case>
                                                        <f:defaultCase>
-                                                               <th>
-                                                                       <f:translate key="field.wordCount"/>
-                                                               </th>
+                                                               <f:if condition="{extensionConfiguration.useMysqlFulltext} == false">
+                                                                       <th>
+                                                                               <f:translate key="field.wordCount"/>
+                                                                       </th>
+                                                               </f:if>
                                                                <th>
                                                                        <f:translate key="field.fileSize"/>
                                                                </th>
                                                                                                        <td>
                                                                                                                {l.fulltextData.fulltextdata}
                                                                                                        </td>
-                                                                                                       <td>
-                                                                                                               <f:for each="{l.allWords}" as="w">
-                                                                                                                       {w}
-                                                                                                               </f:for>
-                                                                                                               <br><br>
-                                                                                                               <em>{f:translate(key:'administration.statistics.count')}: {f:count(subject:l.allWords)}</em>
-                                                                                                       </td>
+                                                                                                       <f:if condition="{extensionConfiguration.useMysqlFulltext} == false">
+                                                                                                               <td>
+                                                                                                                       <f:for each="{l.allWords}" as="w">
+                                                                                                                               {w}
+                                                                                                                       </f:for>
+                                                                                                                       <br><br>
+                                                                                                                       <em>{f:translate(key:'administration.statistics.count')}: {f:count(subject:l.allWords)}</em>
+                                                                                                               </td>
+                                                                                                       </f:if>
                                                                                                </f:case>
                                                                                                <f:defaultCase>
-                                                                                                       <td>{l.wordCount}</td>
+                                                                                                       <f:if condition="{extensionConfiguration.useMysqlFulltext} == false">
+                                                                                                               <td>{l.wordCount}</td>
+                                                                                                       </f:if>
                                                                                                        <td>
                                                                                                                <f:format.bytes decimals="1">{l.item_size}</f:format.bytes>
                                                                                                        </td>