[TYPO3-mvc] The value must be of type "Extension_model_name", but was of type "NULL".

Daniel Dimitrov danielsd_bg at yahoo.fr
Wed Jul 28 09:52:51 CEST 2010


Hi again,
This thing just drives me crazy. All I can say is what the...

Since I cannot get the Product into the database, I thought that I have to 
try to insert at a least the Suppliers.

I created a newAction and createAction in my supplierController:

/**
	 *
	 * @param Tx_BwShop_Domain_Model_Supplier $newSupplier
	 * @dontvalidate $newSupplier
	 */
	public function newAction(Tx_BwShop_Domain_Model_Supplier $newSupplier = 
NULL) {
		$this->view->assign('newSupplier', $newSupplier);
	}

	/**
	 *
	 * @param Tx_BwShop_Domain_Model_Supplier $newSupplier
	 */
	public function createAction(Tx_BwShop_Domain_Model_Supplier $newSupplier) 
{
		var_dump($newSupplier);
		die('create');
	}

my newAction has the following form:
<f:form method="post" controller="Supplier" action="create" 
name="newSupplier" object="{newSupplier}">
	<f:form.textbox property="name" />
	<f:form.submit class="submit" value="Submit"/>
</f:form>
It generates the following html:
<form method="post" name="newSupplier" 
action="mod.php?M=web_BwShopTxBwshopM1&amp;id=&amp;tx_bwshop_web_bwshoptxbwshopm1%5Baction%5D=create&amp;tx_bwshop_web_bwshoptxbwshopm1%5Bcontroller%5D=Supplier">
<input type="hidden" 
name="tx_bwshop_web_bwshoptxbwshopm1[__referrer][extensionName]" 
value="BwShop" />
<input type="hidden" 
name="tx_bwshop_web_bwshoptxbwshopm1[__referrer][controllerName]" 
value="Supplier" />
<input type="hidden" 
name="tx_bwshop_web_bwshoptxbwshopm1[__referrer][actionName]" value="new" />
<input type="hidden" name="tx_bwshop_web_bwshoptxbwshopm1[__hmac]" 
value="a:3:{s:11:&quot;newSupplier&quot;;a:1:{s:4:&quot;name&quot;;i:1;}s:6:&quot;action&quot;;i:1;s:10:&quot;controller&quot;;i:1;}714185186893ea007056523025df380bce279924" 
/>
	<input type="text" name="tx_bwshop_web_bwshoptxbwshopm1[newSupplier][name]" 
value="" />
	<input class="submit" type="submit" name="" value="Submit" />
</form>

When I click on submit I get this error message:

Tx_Extbase_MVC_Exception_NoSuchAction
An action "indexBackendAction" does not exist in controller 
"TX_BwShop_Controller_SupplierController".

Of course the indexBackendAction does not exist - I haven't defined in my 
ext_tables.php and I don't plan to define it.
if (TYPO3_MODE === 'BE')	{
	/**
	 *
	* Registers a Backend Module
	*/
	Tx_Extbase_Utility_Extension::registerModule(
		$_EXTKEY,
		'web',
		'tx_bwshop_m1',	// Submodule key
		'',						// Position
		array(
		'Product' => 'indexBackend, new,create',
		'Supplier' => 'new, create'
		),
		array(
			'access' => 'user,group',
			'icon'   => 'EXT:bw_shop/ext_icon.gif',
			'labels' => 'LLL:EXT:' . $_EXTKEY . 
'/Resources/Private/Language/locallang_mod.xml',
		)
	);

}

The supplier controller has just 2 action new and create. Why the form is 
trying to access the indexBackendAction is a complete mystery for me.

I'm going trough the examples of Jochen & Sebastian in "Typo3 Extensions mit 
Extbase & Fluid" and I don't see what I could be missing here.

Kind Regards,
Daniel
 



More information about the TYPO3-project-typo3v4mvc mailing list