[TYPO3-mvc] Does Extbase handle references of 'inline' records correctly?
Thomas "Thasmo" Deinhamer
thasmo at gmail.com
Wed Dec 23 00:50:44 CET 2009
Hello!
I tried to define a mapping rule,
but somehow this doesn't work neither.
Here's the TypoScript:
http://gist.github.com/262187
I defined the persistence mapping for
both, extbase and hypestore to be sure.
This is what my Structure/Classes look like:
Table: tx_hypestore_domain_model_product_price
ClassFile: Classes/Domain/Model/ProductPrice.php
ClassName: Tx_HypeStore_Domain_Model_ProductPrice
Table: tx_hypestore_domain_model_product_attribute
ClassFile: Classes/Domain/Model/ProductAttribute.php
ClassName: Tx_HypeStore_Domain_Model_ProductAttribute
The error message is:
---
Tx_Extbase_Persistence_Storage_Exception_SqlError
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near '* FROM
tx_hypestore_domain_model_product_price LEFT JOIN ON
tx_hypestore_domain' at line 1
---
Between 'LEFT JOIN' and 'ON' the table is missing.
Do I have to consider something else to get this working?
Thanks,
Thomas
Jochen Rau schrieb:
> Hi.
>
> schrieb Thomas "Thasmo" Deinhamer:
>> Hello!
>>
>> Accessing related ('inline') objects inside a fluid template,
>> gives me a SQL error, like (shortended):
>>
>> "SELECT * FROM tx_EXT_domain_model_table LEFT JOIN ON tx_EXT_domain..."
>>
>> For some reason after 'LEFT JOIN' the table is missing which should
>> get joined inside the query. Unfortunately I have no clue which table
>> should get joined there, as the error message truncated the SQL query,
>> thererfore I don't know what is queried.
>>
>> Is there a problem with the TCA of inline records regarding Extbase?
>>
>> I must admit, that my table names for inline records are named
>> a bit different than the other tables. These are my tables and
>> their model classes:
>>
>> PRODUCT
>> Table: tx_EXT_domain_model_product
>> ClassFile: Classes/Domain/Model/Product.php
>> ClassName: Tx_EXT_Domain_Model_Product
>>
>> PRODUCT PRICE
>> Table: tx_EXT_domain_model_product_price
>> ClassFile: Classes/Domain/Model/ProductPrice.php
>> ClassName: Tx_EXT_Domain_Model_ProductPrice
>>
>> Could this be the reason for the SQL error?
>
> Yes. By default, the table name must be the class name in lowercase.
>
> tx_EXT_domain_model_productprice
>
> instead of
>
> tx_EXT_domain_model_product_price
>
> Otherwise you have to define a mapping rule (see
> ext_typoscript_setup.txt of Extbase).
>
> Regards
> Jochen
>
More information about the TYPO3-project-typo3v4mvc
mailing list