[TYPO3-commerce] Strange code in pi1
Ingo Schmitt
is at marketing-factory.de
Mon May 23 16:59:02 CEST 2011
Hi Michael,
if you extend the frontend PI1 class by your extension you will have the prefixID tx_myextension. Since these PIvars are not present in Commerce, this remapps the pivars to the commerce vars.
I have implemented this solution, since the access to the pivars is not implemented at only one place.
Removing this, would break some installations based on commerce.
We should write a method to get the pivars, which is used at all places in commerce. Maybe we could start during the refactoring of pi2,pi3 and pi6?
Regards
ingo
> Hi folks,
>
> I'm just trying to clean up the code in tx_commerce_pi1 and stumbled
> about a strange piece of code in the init-method:
>
> // Merge default vars, if other prefix_id
> if ($this->prefixID <> 'tx_commerce_pi1') {
> $tx_commerce_vars = t3lib_div::_GP('tx_commerce');
> if (is_array($tx_commerce_vars)) {
> foreach($tx_commerce_vars as $key => $value) {
> if (empty($this->piVars[$key])) {
> $this->piVars[$key] = $value;
> }
> }
> }
> }
>
> It overwrites the get-variables with gp-values prefixed with tx_commerce
> if the prefixID is not set to pi1. To me this looks like an ugly hack
> that should be removed. However I wasn't able to find out if this is
> used anywhere.
> SVN shows that this feature was added by Ingo in 2008. Can anyone
> (preferably Ingo of cause) explain why and where this is needed so I can
> try to refactor it?
>
> Cheers, Michael
> _______________________________________________
> TYPO3-project-commerce mailing list
> TYPO3-project-commerce at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce
>
>
Mit freundlichen Gruessen
Ingo Schmitt
*** BITTE BEACHTEN SIE UNSERE NEUE ANSCHRIFT! ***
--
Marketing Factory Consulting GmbH * mailto:is at marketing-factory.de
Marienstrasse 14 * Tel.: +49 211-361176-63
D-40212 Duesseldorf, Germany * Fax: +49 211-361176-99
Amtsgericht Duesseldorf HRB 53971 * http://www.marketing-factory.de/
Geschaeftsfuehrer: Peter Faisst | Katja Faisst
Karoline Steinfatt | Christoph Allefeld | Markus M. Kimmel
More information about the TYPO3-project-commerce
mailing list