[TYPO3-core] RFC #10259: Bug: Update reference index contains misleading (wrong!) instructions

Daniel Krupke email at danielkrupke.de
Sun Feb 22 21:54:13 CET 2009


This is an SVN patch request.

Type: Bugfix

Bugtracker references:
http://bugs.typo3.org/view.php?id=10259
http://bugs.typo3.org/view.php?id=9710
http://bugs.typo3.org/view.php?id=7482
http://bugs.typo3.org/view.php?id=6248


Branches:
trunk


Problem:
DB Check module references deprecated script file.


Solution:
Instruct user to use CLI script for updating/checking reference index
and add further details.

Notes:
bug10259_trunk.patch.txt is patch for trunk



so long,
Daniel Krupke
-------------- next part --------------
Index: typo3/sysext/lowlevel/dbint/index.php
===================================================================
--- typo3/sysext/lowlevel/dbint/index.php	(revision 5018)
+++ typo3/sysext/lowlevel/dbint/index.php	(working copy)
@@ -29,6 +29,8 @@
  *
  * This module lets you check if all pages and the records relate properly to each other
  *
+ * $Id$
+ *
  * @author	Kasper Skaarhoj <kasperYYYY at typo3.com>
  * @coauthor	Jo Hasenau <info at cybercraft.de>
  */
@@ -156,17 +158,17 @@
 			// Values NOT in this array will not be saved in the settings-array for the module.
 		$this->MOD_MENU = array(
 			'function' => array(
-				0 => '[ MENU ]',
-				'records' => 'Record Statistics',
-				'tree' => 'Total Page Tree',
-				'relations' => 'Database Relations',
-				'search' => 'Full search',
-				'filesearch' => 'Find filename',
-				'refindex' => 'Manage Reference Index',
+				0 => $LANG->getLL('menu_0'),
+				'records' => $LANG->getLL('menu_records'),
+				'tree' => $LANG->getLL('menu_tree'),
+				'relations' => $LANG->getLL('menu_relations'),
+				'search' => $LANG->getLL('menu_search'),
+				'filesearch' => $LANG->getLL('menu_filesearch'),
+				'refindex' => $LANG->getLL('menu_refindex')
 			),
 			'search' => array(
-				'raw' => 'Raw search in all fields',
-				'query' => 'Advanced query'
+				'raw' => $LANG->getLL('search_option_raw'),
+				'query' => $LANG->getLL('search_option_query')
 			),
 
 			'search_query_smallparts' => '',
@@ -189,11 +191,11 @@
 			'storeQueryConfigs' => '',	// Used to store the available Query configs in memory
 
 			'search_query_makeQuery' => array(
-				'all' => 'Select records',
-				'count' => 'Count results',
-				'explain' => 'Explain query',
-				'csv' => 'CSV Export',
-				'xml' => 'XML Export'
+				'all' => $LANG->getLL('search_query_all'),
+				'count' => $LANG->getLL('search_query_count'),
+				'explain' => $LANG->getLL('search_query_explain'),
+				'csv' => $LANG->getLL('search_query_csv'),
+				'xml' => $LANG->getLL('search_query_xml')
 			),
 
 			'sword' => ''
@@ -359,7 +361,7 @@
 	 * @return	void
 	 */
 	function func_refindex()	{
-		global $TYPO3_DB,$TCA;
+		global $TYPO3_DB,$TCA,$LANG;
 
 		if (t3lib_div::_GP('_update') || t3lib_div::_GP('_check'))	{
 			$testOnly = t3lib_div::_GP('_check')?TRUE:FALSE;
@@ -373,11 +375,15 @@
 		}
 
 			// Output content:
-		$content = 'Click here to update reference index: <input type="submit" name="_update" value="Update now!" /><br/>';
-		$content.= 'Click here to test reference index: <input type="submit" name="_check" value="Check now!" /><br/>';
-		$content.= 'You can also run the check as a shell script if the processing takes longer than the PHP max_execution_time allows:<br/>'.
-					t3lib_extMgm::extPath('lowlevel').'dbint/cli/refindex_cli.phpsh';
-		$this->content.=$this->doc->section('Update reference index',$content,0,1);
+		$content = $LANG->getLL('refindex_update_label') . '<input type="submit" name="_update" value="' . $LANG->getLL('refindex_update_button') . '" /><br />';
+		$content.= $LANG->getLL('refindex_test_label') . '<input type="submit" name="_check" value="' . $LANG->getLL('refindex_test_button') . '" /><br /><br />';
+		$content.= '<p>' . $LANG->getLL('refindex_script_description') . '</p><br />';
+		$content.= '<p>' . $LANG->getLL('refindex_script_check_description') . '<br />' . 
+					$LANG->getLL('refindex_script_check_example') . '</p><br />';
+		$content.= '<p>' . $LANG->getLL('refindex_script_update_description') . '<br />' . 
+					$LANG->getLL('refindex_script_update_example') . '</p><br />';
+		$content.= '<p>' . $LANG->getLL('refindex_script_more') . '</p>';
+		$this->content .= $this->doc->section($LANG->getLL('refindex_section_title'), $content, 0, 1);
 	}
 
 	/**
@@ -401,23 +407,23 @@
 			$menu2 .= t3lib_BEfunc::getFuncMenu(0, 'SET[search_query_makeQuery]', $this->MOD_SETTINGS['search_query_makeQuery'], $this->MOD_MENU['search_query_makeQuery']). '<br />';
 		}
 		if (!$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableTopCheckboxes'] && $this->MOD_SETTINGS['search']=='query')	{
-			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[search_query_smallparts]', $this->MOD_SETTINGS['search_query_smallparts'],'','','id="checkSearch_query_smallparts"').'&nbsp;<label for="checkSearch_query_smallparts">Show SQL parts</label><br />';
-			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[search_result_labels]', $this->MOD_SETTINGS['search_result_labels'],'','','id="checkSearch_result_labels"').'&nbsp;<label for="checkSearch_result_labels">Use formatted strings, labels and dates instead of original values for results</label><br />';
-			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[labels_noprefix]', $this->MOD_SETTINGS['labels_noprefix'],'','','id="checkLabels_noprefix"').'&nbsp;<label for="checkLabels_noprefix">Don\'t use original values in brackets as prefix for labelled results</label><br />';
-			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[options_sortlabel]', $this->MOD_SETTINGS['options_sortlabel'],'','','id="checkOptions_sortlabel"').'&nbsp;<label for="checkOptions_sortlabel">Sort selectbox options for relations by label and not by value</label><br />';
-			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[show_deleted]', $this->MOD_SETTINGS['show_deleted'],'','','id="checkShow_deleted"').'&nbsp;<label for="checkShow_deleted">Show even deleted entries (with undelete buttons)</label>';
+			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[search_query_smallparts]', $this->MOD_SETTINGS['search_query_smallparts'],'','','id="checkSearch_query_smallparts"').'&nbsp;<label for="checkSearch_query_smallparts">' . $LANG->getLL('search_query_option_search_query_smallparts') . '</label><br />';
+			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[search_result_labels]', $this->MOD_SETTINGS['search_result_labels'],'','','id="checkSearch_result_labels"').'&nbsp;<label for="checkSearch_result_labels">' . $LANG->getLL('search_query_option_search_result_labels') . '</label><br />';
+			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[labels_noprefix]', $this->MOD_SETTINGS['labels_noprefix'],'','','id="checkLabels_noprefix"').'&nbsp;<label for="checkLabels_noprefix">' . $LANG->getLL('search_query_option_labels_noprefix') . '</label><br />';
+			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[options_sortlabel]', $this->MOD_SETTINGS['options_sortlabel'],'','','id="checkOptions_sortlabel"').'&nbsp;<label for="checkOptions_sortlabel">' . $LANG->getLL('search_query_option_options_sortlabel') . '</label><br />';
+			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[show_deleted]', $this->MOD_SETTINGS['show_deleted'],'','','id="checkShow_deleted"').'&nbsp;<label for="checkShow_deleted">' . $LANG->getLL('search_query_option_show_deleted') . '</label>';
 		}
 
 		$this->content.= $this->doc->section('',$menu2).$this->doc->spacer(10);
 
 		switch($this->MOD_SETTINGS['search'])		{
 			case 'query':
-				$this->content.=$fullsearch->queryMaker();
+				$this->content.= $fullsearch->queryMaker();
 			break;
 			case 'raw':
 			default:
-				$this->content.=$this->doc->section('Search options:',$fullsearch->form(),0,1);
-				$this->content.=$this->doc->section('Result:',$fullsearch->search(),0,1);
+				$this->content.= $this->doc->section($LANG->getLL('search_section_title_search_options'), $fullsearch->form(), 0, 1);
+				$this->content.= $this->doc->section($LANG->getLL('search_section_title_result'), $fullsearch->search(), 0, 1);
 			break;
 		}
 	}
@@ -529,9 +535,9 @@
 					reset($admin->lRecords[$t]);
 					while(list(,$data)=each($admin->lRecords[$t]))	{
 						if (!t3lib_div::inList($admin->lostPagesList,$data[pid]))	{
-							$lr.='<nobr><b><a href="index.php?SET[function]=records&fixLostRecords_table='.$t.'&fixLostRecords_uid='.$data[uid].'"><img src="'.$BACK_PATH.'gfx/required_h.gif" width="10" hspace="3" height="10" border="0" align="top" title="'.$LANG->getLL('fixLostRecord').'"></a>uid:'.$data[uid].', pid:'.$data[pid].', '.t3lib_div::fixed_lgd(strip_tags($data[title]),20).'</b></nobr><br>';
+							$lr.='<nobr><strong><a href="index.php?SET[function]=records&fixLostRecords_table='.$t.'&fixLostRecords_uid='.$data[uid].'"><img src="'.$BACK_PATH.'gfx/required_h.gif" width="10" hspace="3" height="10" border="0" align="top" title="'.$LANG->getLL('fixLostRecord').'"></a>uid:'.$data[uid].', pid:'.$data[pid].', '.t3lib_div::fixed_lgd(strip_tags($data[title]),20).'</strong></nobr><br />';
 						} else {
-							$lr.='<nobr><img src="'.$BACK_PATH.'clear.gif" width="16" height="1" border="0"><font color="Gray">uid:'.$data[uid].', pid:'.$data[pid].', '.t3lib_div::fixed_lgd(strip_tags($data[title]),20).'</font></nobr><br>';
+							$lr.='<nobr><img src="'.$BACK_PATH.'clear.gif" width="16" height="1" border="0"><font color="Gray">uid:'.$data[uid].', pid:'.$data[pid].', '.t3lib_div::fixed_lgd(strip_tags($data[title]),20).'</font></nobr><br />';
 						}
 					}
 				}
@@ -565,7 +571,7 @@
 		$code='';
 		if (is_array($fileTest['noReferences']))	{
 			while(list(,$val)=each($fileTest['noReferences']))	{
-				$code.='<nobr>'.$val[0].'/<b>'.$val[1].'</b></nobr><br>';
+				$code.= '<nobr>' . $val[0] . '/' . '<strong>' . $val[1] . '</strong></nobr><br />';
 			}
 		}
 		$this->content.=$this->doc->section($LANG->getLL('files_no_ref'),$code,1,1);
@@ -573,7 +579,7 @@
 		$code='';
 		if (is_array($fileTest['moreReferences']))	{
 			while(list(,$val)=each($fileTest['moreReferences']))	{
-				$code.='<nobr>'.$val[0].'/<b>'.$val[1].'</b>: '.$val[2].' references:</nobr><br>'.$val[3].'<br><br>';
+				$code.= '<nobr>' . $val[0] . '/' . '<strong>' . $val[1] . '</strong>: ' . $val[2] . ' ' . $LANG->getLL('relations_references') . ':</nobr><br />' . $val[3] . '<br /><br />';
 			}
 		}
 		$this->content.=$this->doc->section($LANG->getLL('files_many_ref'),$code,1,1);
@@ -583,7 +589,7 @@
 			ksort($fileTest['noFile']);
 			reset($fileTest['noFile']);
 			while(list(,$val)=each($fileTest['noFile']))	{
-				$code.='<nobr>'.$val[0].'/<b>'.$val[1].'</b> is missing! </nobr><br>Referenced from: '.$val[2].'<br><br>';
+				$code.= '<nobr>' . $val[0] . '/' . '<strong>' . $val[1] . '</strong> ' . $LANG->getLL('relations_missing') . ' </nobr><br />' . $LANG->getLL('relations_referenced_from') . ': ' . $val[2] . '<br /><br />';
 			}
 		}
 		$this->content.=$this->doc->section($LANG->getLL('files_no_file'),$code,1,1);
@@ -597,9 +603,11 @@
 	 * @return	void
 	 */
 	function func_filesearch()	{
+		global $LANG;
+		
 		$pattern = t3lib_div::_GP('pattern');
-		$pcontent = 'Enter regex pattern: <input type="text" name="pattern" value="'.htmlspecialchars($pattern?$pattern:$GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern']).'"> <input type="submit" name="Search">';
-		$this->content.= $this->doc->section('Pattern',$pcontent,0,1);
+		$pcontent = $LANG->getLL('filesearch_enter_regex_pattern') . ' <input type="text" name="pattern" value="' . htmlspecialchars($pattern ? $pattern : $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern']) . '"> <input type="submit" name="Search">';
+		$this->content.= $this->doc->section($LANG->getLL('filesearch_section_title_pattern'), $pcontent, 0, 1);
 
 		if (strcmp($pattern,''))	{
 			$dirs = t3lib_div::get_dirs(PATH_site);
@@ -607,23 +615,23 @@
 			$depth=10;
 
 			foreach ($dirs as $key => $value) {
-				$matching_files=array();
-				$info='';
+				$matching_files = array();
+				$info = '';
 				if (!t3lib_div::inList('typo3,typo3conf,tslib,media,t3lib',$value))	{
 					$info = $this->findFile(PATH_site.$value.'/',$pattern,$matching_files,$depth);
 				}
 				if (is_array($info))	{
-					$lines[]='<hr><b>'.$value.'/</b> being checked...';
-					$lines[]='Dirs: '.$info[0];
+					$lines[] = '<hr /><strong>' . $value . '/</strong> ' . $LANG->getLL('filesearch_dir_being_checked');
+					$lines[] = $LANG->getLL('filesearch_result_dirs') . ' ' . $info[0];
 					if ($info[2])	$lines[]='<span class="typo3-red">ERROR: Directories deeper than '.$depth.' levels</span>';
-					$lines[]='Files: '.$info[1];
-					$lines[]='Matching files:<br><nobr><span class="typo3-red">'.implode('<br>',$matching_files).'</span></nobr>';
+					$lines[] = $LANG->getLL('filesearch_result_files') . ' ' . $info[1];
+					$lines[] = $LANG->getLL('filesearch_result_matching_files') . '<br /><nobr><span class="typo3-red">' . implode('<br />', $matching_files) . '</span></nobr>';
 				} else {
-					$lines[]=$GLOBALS['TBE_TEMPLATE']->dfw('<hr><b>'.$value.'/</b> not checked.');
+					$lines[] = $GLOBALS['TBE_TEMPLATE']->dfw('<hr /><strong>' . $value . '/</strong> ' . $LANG->getLL('filesearch_dir_not_checked'));
 				}
 			}
 
-			$this->content.=$this->doc->section('Searching for filenames:',implode('<br>',$lines),0,1);
+			$this->content.=$this->doc->section($LANG->getLL('filesearch_section_title_result'), implode('<br />', $lines), 0, 1);
 		}
 	}
 
Index: typo3/sysext/lowlevel/dbint/locallang.xml
===================================================================
--- typo3/sysext/lowlevel/dbint/locallang.xml	(revision 5018)
+++ typo3/sysext/lowlevel/dbint/locallang.xml	(working copy)
@@ -31,6 +31,49 @@
             <label index="refindex">Check and update global reference index</label>
             <label index="refindex_description">Allows you to maintain the reference index kept by TYPO3.</label>
             <label index="title">Database integrity check</label>
+			<label index="menu_0">[ MENU ]</label>
+			<label index="menu_records">Record Statistics</label>
+			<label index="menu_tree">Total Page Tree</label>
+			<label index="menu_relations">Database Relations</label>
+			<label index="menu_search">Full search</label>
+			<label index="menu_filesearch">Find filename</label>
+			<label index="menu_refindex">Manage Reference Index</label>
+			<label index="search_option_raw">Raw search in all fields</label>
+			<label index="search_option_query">Advanced query</label>
+			<label index="search_section_title_search_options">Search options:</label>
+			<label index="search_section_title_result">Result:</label>
+			<label index="search_query_all">Select records</label>
+			<label index="search_query_count">Count results</label>
+			<label index="search_query_explain">Explain query</label>
+			<label index="search_query_csv">CSV Export</label>
+			<label index="search_query_xml">XML Export</label>
+			<label index="search_query_option_search_query_smallparts">Show SQL parts</label>
+			<label index="search_query_option_search_result_labels">Use formatted strings, labels and dates instead of original values for results</label>
+			<label index="search_query_option_labels_noprefix">Don't use original values in brackets as prefix for labelled results</label>
+			<label index="search_query_option_options_sortlabel">Sort selectbox options for relations by label and not by value</label>
+			<label index="search_query_option_show_deleted">Show even deleted entries (with undelete buttons)</label>
+			<label index="refindex_update_label">Click here to update reference index: </label>
+			<label index="refindex_update_button">Update now!</label>
+			<label index="refindex_test_label">Click here to test reference index: </label>
+			<label index="refindex_test_button">Check now!</label>
+			<label index="refindex_section_title">Update reference index</label>
+			<label index="refindex_script_description">You can also run the check as a shell script using CLI if the processing takes longer than the PHP max_execution_time allows.</label>
+			<label index="refindex_script_check_description">To check the reference index use:</label>
+			<label index="refindex_script_check_example">php /path/to/your/typo3/cli_dispatch.phpsh lowlevel_refindex -c</label>
+			<label index="refindex_script_update_description">To update the reference index use:</label>
+			<label index="refindex_script_update_example">php /path/to/your/typo3/cli_dispatch.phpsh lowlevel_refindex -e</label>
+			<label index="refindex_script_more">Make sure that a BE user with the name _cli_lowlevel exists. For more details see: /path/to/your/typo3/sysext/lowlevel/HOWTO_clean_up_TYPO3_installations.txt</label>
+			<label index="filesearch_section_title_pattern">Pattern</label>
+			<label index="filesearch_section_title_result">Searching for filenames:</label>
+			<label index="filesearch_dir_being_checked">being checked ...</label>
+			<label index="filesearch_dir_not_checked">not checked.</label>
+			<label index="filesearch_result_dirs">Dirs:</label>
+			<label index="filesearch_result_files">Files:</label>
+			<label index="filesearch_result_matching_files">Matching Files:</label>
+			<label index="filesearch_enter_regex_pattern">Enter regex pattern:</label>
+			<label index="relations_references">references</label>
+			<label index="relations_missing">is missing!</label>
+			<label index="relations_referenced_from">Referenced from</label>
         </languageKey>
     </data>
 </T3locallang>
\ No newline at end of file


More information about the TYPO3-team-core mailing list