[TYPO3-commerce] Remove of deprecated method call get_parent_categorie()
Benny Schimmer
bschimmer at cross-content.com
Mon Aug 1 19:17:05 CEST 2011
Hi list,
since i updated an installation to TYPO3 4.5 i get a lot of deprecation
warnings:
tx_commerce_db_product->get_parent_categorie()
tx_commerce_db_product->get_parent_category() - use getParentCategories
instead; note that getParentCategories will return an array
I fixed this in the attached Patch, but im not happy with this change.
The situation so far:
tx_commerce_pi1->initSingleView calls the method
$this->product->get_masterparent_categorie()
This method is only a deprecated wrapper for getMasterparentCategory() so
the change in the pi1 is ok i think.
tx_commerce_product->getMasterparentCategory() calls
tx_commerce_db_product->get_parent_categorie (wrapper for
get_parent_category).
There the category is selectec from the 'categories'-field from
products-db-table. If the result is a comma-seperated list, the first value
is returned.
Now:
Since the product->category relation is now stored in a mm table i changed
the call of tx_commerce_db_product->get_parent_categorie to
getParentCategories and i am returning the first array-element.
I did not change the behavior, but is this really reasonable to return the
first category the product is associated with?
Greetings,
Benny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: commerce_patch.patch
Type: application/octet-stream
Size: 1071 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-commerce/attachments/20110801/73cad8ff/attachment.obj>
More information about the TYPO3-team-commerce
mailing list