[TYPO3-mvc] sub-object access gives InvalidArgumentException

"Christian Müller [kitsunet]" christian at kitsunet.de
Thu Jun 17 16:01:22 CEST 2010


A new day, a new view... I found my stupidity. I changed the TCA from 
type "group" to type "select" but didn't change 'allowed' to 
'foreign_table', so that is solved...


On 16.06.2010 21:56, "Christian Müller (Kitsunet)" wrote:
> So, I probably miss something very easy, but I went over it again and
> again and don't see it...
>
> In my template I try:
> {reference.customer.company} and get InvalidArgumentException
>
> {reference.customer} only gives me the customer uid...
>
> I have a table tx_knmvcdb_domain_model_reference field customer defined
> like that in TCA:
>
> 'customer' => array (
> 'exclude' => 1,
> 'label' =>
> 'LLL:EXT:knmvcdb/locallang_db.xml:tx_knmvcdb_domain_model_reference.customer',
>
> 'config' => array (
> 'type' => 'select',
> 'allowed' => 'tx_knmvcdb_domain_model_customer',
> 'maxitems' => 1,
> )
> ),
>
>
> In Tx_Knmvcdb_Domain_Model_Reference:
>
>
> ....snip...
>
> /**
> * @var Tx_Knmvcdb_Domain_Model_Customer
> */
> protected $customer;
>
> ....snip...
>
> /**
> * Set the Customer value
> * @param Tx_Knmvcdb_Domain_Model_Customer $param_Customer
> */
> public function setCustomer(Tx_Knmvcdb_Domain_Model_Customer
> $param_Customer ) {
> $this->customer = $param_Customer;
> }
>
> /**
> * Returns the Customer value.
> * @return Tx_Knmvcdb_Domain_Model_Customer
> */
> public function getCustomer() { return $this->customer; }
>
> ....snip...
>
>
> And of course Tx_Knmvcdb_Domain_Model_Customer exists with a property
> $company and
>
> ....snip...
>
> /**
> * Returns the Company value.
> * @return string
> */
> public function getCompany() {
> return $this->company;
> }
>
> ....snip...
>
> So at what point am I missing the configuration magic to have the
> customer object instead of uid only...
>
> I can use the respective repositories just fine and render eg. a list of
> all existing customers (with company name - the company property), so
> that makes me believe that my models can't be that bad... but obviously
> something is wrong.
>
> I am using ExtBase 1.0.2 and fluid 1.0.2 as shipping with TYPO3 4.3.3.
>
> Thanks,
> Christian




More information about the TYPO3-project-typo3v4mvc mailing list