akeeba/fof — pull request #13 by rdeutz (2013-05-02 21:20:53+00:00)
Title: setting the view with nothing doesn't makes sense

if you do a $input->set('view', $config['view']) when $config['view'] is empty then the public $defaultView = 'items' in the dispatcher hasn't an effect. I have found this as I did a vanilla installation of fof and todo. If I click on the menu for todo I end in a add screen with a broken form. After some debugging I have seen that this code let it fail finally:

// Get the default values for the component and view names
$this->component = $this->input->getCmd('option', 'com_foobar');
*1	$this->view = $this->input->getCmd('view', $this->defaultView);

// Load the component's fof.xml configuration file
$configProvider = new FOFConfigProvider;
*2	$this->defaultView = $configProvider->get($this->component . '.dispatcher.default_view', 'cpanel');

*3	if (empty($this->view))
{
$this->view = $this->defaultView;
}

*1 $this->view will be set with "", because view is set; $this->defaultView == 'items' at this point

*2 $this->defaultView = 'cpanel'

*3 empty($this->view) == true

--> $this->view = 'cpanel' # Winner