[TYPO3-core] RFC #8231: DBAL's bug admin_get_charsets() on a non-object

Michael Miousse mmiousse at infoglobe.ca
Thu May 7 17:02:58 CEST 2009


Le Thu, 07 May 2009 08:39:49 +0200, Xavier Perseguers a écrit :

> Hi Karsten,
> 
>> On 02.05.2009, at 17:05, Xavier Perseguers wrote:
>>> Use patch to test whether the method exists and return an empty array
>>> otherwise.
>> 
>> +1 by reading, but maybe the "ENGINE"-Fix should go in a separate
>> commit.
> 
> Attached is the patch without the "ENGINE"-fix which is not tackled with
> in RFC #11040.
> 
> Regards
> 
> --
> Xavier Perseguers
> DBAL-Member
> 
> http://xavier.perseguers.ch/en/tutorials/typo3.html Index:
> t3lib/class.t3lib_install.php
> =================================================================== ---
> t3lib/class.t3lib_install.php	(revision 5381) +++
> t3lib/class.t3lib_install.php	(working copy) @@ -460,9 +460,14 @@
>  	function getCollationForCharset($charset)	{
>  			// Load character sets, if not cached already
>  		if (!count($this->character_sets)) {
> -			$this->character_sets = $GLOBALS['TYPO3_DB']->admin_get_charsets();
> +			if (method_exists($GLOBALS['TYPO3_DB'],'admin_get_charsets')) { +			
> $this->character_sets = $GLOBALS['TYPO3_DB']->admin_get_charsets(); +		
> } else {
> +				$this->character_sets[$charset] = array();	// Add empty element to
> avoid that the check will be repeated +			}
>  		}
>  
> +		$collation = '';
>  		if (isset($this->character_sets[$charset]['Default collation'])) {
>  			$collation = $this->character_sets[$charset]['Default collation'];
>  		}
> Index: typo3/sysext/dbal/class.ux_t3lib_db.php
> =================================================================== ---
> typo3/sysext/dbal/class.ux_t3lib_db.php	(revision 5381) +++
> typo3/sysext/dbal/class.ux_t3lib_db.php	(working copy) @@ -1949,6
> +1949,15 @@
>  	}
>  
>  	/**
> +	 * mysql() wrapper function, used by the Install Tool. +	 *
> +	 * @return	array
> +	 */
> +	function admin_get_charsets() {
> +		return array();
> +	}
> +
> +	/**
>  	 * mysql() wrapper function, used by the Install Tool and EM for all
>  	 queries regarding management of the database! *
>  	 * @param	string		Query to execute
> @@ -2671,4 +2680,4 @@
>  	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dbal/class.ux_t3lib_db.php']);
>  }
>  
> -?>
> \ No newline at end of file
> +?>

+1 by testing


More information about the TYPO3-team-core mailing list