[TYPO3-core] RFC #17182: migrateWorkspaces in Install-Tool shows up even if nothing has to be done

François Suter fsu-lists at cobweb.ch
Fri Jan 21 21:03:08 CET 2011


Hi,

> Solution:
> The attached patch checks if the old style admin field is used or if
> there are any workspaces which use stages without having
> sys_workspace_stage records assigned - this way the wizard won't show up
> if it ran once.

+1 after reading and testing. There a few small things to fix, though.

> +	/**
> +	 * Returns all sys_workspace records which are not referenced by  anysys_workspace_stages record

 
  ^ blanks gone awry

> +	 *
> +	 * @return array
> +	 */
> +	protected function getWorkspacesWithoutStages() {
> +		$stages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('parentid', 'sys_workspace_stages', 'parenttable="sys_workspace"');

You fell back to the plural name of the table, out of habit I guess ;-) 
It should be "sys_workspace_stage".

> +		$wsWhitelist = array();

We're trying to avoid using abbreviations and acronyms. Could you please 
rename to $workspaceWhiteList (and not the camel-case too)?

> +		foreach ($stages as $stage) {
> +			$wsWhitelist[] = $stage['parentid'];
> +		}

Shouldn't array_unique() be called at this point? I would expect some 
"parentid" values to appear several times.

All this is rather minor (except the typo in the table name) and can be 
changed upon commit. So go! :-)

Thanks

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-team-core mailing list