[TYPO3-mvc] |!!!] BREAKING CHANGE: FYI: Handling of Settings and Extbase configuration

Xavier Perseguers typo3 at perseguers.ch
Fri Aug 7 09:55:02 CEST 2009


Hi Sebastian,

>>> What about Tx_Extbase_Dispatcher::getSettings() that went away?
>>
>> Was it officially changed to extbaseFrameworkConfiguration?
> Yep, sorry, forgot to mention this here.
> 
> However, what I said quite some time again applies: To me, 
> Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration() is NOT a 
> public API method. We should discuss in which use-cases this is needed 
> inside custom code and try to find a better solution for these use-cases 
> :-)

I guess we'll have to talk very soon as I face what seems to be a big problem after change from revision 972.

The settings injection is in Dispatcher:
$controller->injectSettings($this->configurationManager->getSettings($request->getControllerExtensionName()));

Now, what we did in mvc_extjs is as follows:

/**
  * Initializes the action.
  *
  * Beware: make sure to call parent::initializeAction if you need to do something in your child class
  */
protected function initializeAction() {
	if (TYPO3_MODE === 'BE') {
		$this->injectSettings(Tx_Extbase_Dispatcher::getSettings());


After reading how it is done in new versions of Extbase, I was happy to see that the settings injection is automatically done for us during the preparation of the controller in Tx_Extbase_Dispatcher. 
So far so great, meaning we don't have to care anymore about this. But! Something else changed and it seems to be a bug because when I now output $this->settings (from controller), it always is an 
empty array, in Backend *and* Frontend. Meaning a few lines after the code I wrote for initializeAction above, I have this:

$this->scBase = t3lib_div::makeInstance('t3lib_SCbase');
$this->scBase->MCONF['name'] = $this->settings['pluginName'];
$this->scBase->init();

Going through my code, it seems I only had to deal with $this->settings['pluginName'], not any other setting but many time, meaning it cannot work anymore when there is no settings ;-)

This is a blocking point but as said, seems to be a bug somewhere.

The other point I don't like is having to use method initializeAction in my intermediate ActionController layer when dealing with ExtJS in order for inheritating classes to be able to get full ExtJS 
power. As Extbase's ActionController was not meant as being able to be subclassed once before being actually used by some "useful" code, there is a single "abstract"/not implemented method in 
ActionController that I may use to add some logic before the action actually is processed, but this means that classes extending *my* ActionController (which in turn extends yours) have to remember 
calling parent::initializeAction() whenever they want to initialize something for their own actions. I don't like it much.

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en

One contribution a day keeps the fork away


More information about the TYPO3-project-typo3v4mvc mailing list