From 71fc86eb5445775bee19ce65e1ea973c76771f8f Mon Sep 17 00:00:00 2001 From: Franz Holzinger Date: Thu, 21 Nov 2019 18:53:59 +0100 Subject: [PATCH] * bugfix: The recs POST data and FE sessions are available only in the Front End. --- ChangeLog | 2 + .../TCA/tt_products_products_mm_articles.php | 2 +- composer.json | 2 +- control/class.tx_ttproducts_control.php | 2 +- eid/class.tx_ttproducts_db.php | 53 +++++++++++-------- ext_conf_template.txt | 2 + ext_emconf.php | 2 +- view/class.tx_ttproducts_relatedlist_view.php | 2 +- 8 files changed, 39 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03df8e06c..871224897 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +2019-11-21 Franz Holzinger + * bugfix: The recs POST data and FE sessions are available only in the Front End. 2019-11-04 Franz Holzinger * bugfix: The object of tx_ttproducts_basket has no basketExtra member variable. Use tx_ttproducts_control_basket::getBasketExtra() instead. diff --git a/Configuration/TCA/tt_products_products_mm_articles.php b/Configuration/TCA/tt_products_products_mm_articles.php index 3a268d435..fd87898de 100755 --- a/Configuration/TCA/tt_products_products_mm_articles.php +++ b/Configuration/TCA/tt_products_products_mm_articles.php @@ -3,7 +3,7 @@ $result = NULL; -if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TT_PRODUCTS_EXT]['articleMode'] == '2') { +if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TT_PRODUCTS_EXT]['articleMode'] >= '1') { $result = array ( 'ctrl' => array ( 'title' => 'LLL:EXT:' . TT_PRODUCTS_EXT . '/locallang_db.xml:tt_products_products_mm_articles', diff --git a/composer.json b/composer.json index a8c31e65c..22a3f43da 100755 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ ], "require": { "typo3/cms-core": ">=6.2.0,<8.99.99", - "jambagecom/div2007": ">=1.10.24", + "jambagecom/div2007": ">=1.10.25", "jambagecom/table": ">=0.7.0", "jambagecom/tsparser": ">=0.2.5" }, diff --git a/control/class.tx_ttproducts_control.php b/control/class.tx_ttproducts_control.php index 097d913b7..21828b764 100755 --- a/control/class.tx_ttproducts_control.php +++ b/control/class.tx_ttproducts_control.php @@ -467,7 +467,7 @@ public function getContent ( if ($this->activityArray['products_overview']) { tx_div2007_alpha5::load_noLinkExtCobj_fh002($this->pibase); // $contentEmpty = $this->cObj->getSubpart( - templateCode, + $templateCode, $this->subpartmarkerObj->spMarker('###BASKET_OVERVIEW_EMPTY' . $this->config['templateSuffix'] . '###') ); diff --git a/eid/class.tx_ttproducts_db.php b/eid/class.tx_ttproducts_db.php index 5119516bf..e10352f27 100755 --- a/eid/class.tx_ttproducts_db.php +++ b/eid/class.tx_ttproducts_db.php @@ -75,28 +75,35 @@ public function init (&$conf, &$config, &$ajax, &$pObj) { $this->cObj->start(array()); } - $recs = GeneralUtility::_GP('recs'); - - if ( - is_array($recs) && - $conf['transmissionSecurity'] - ) { - $errorCode = array(); - $errorMessage = ''; - $security = GeneralUtility::makeInstance(\JambageCom\Div2007\Security\TransmissionSecurity::class); - $decryptionResult = $security->decryptIncomingFields( - $recs, - $errorCode, - $errorMessage - ); - } - - if (is_array($recs)) { - $api = GeneralUtility::makeInstance( \JambageCom\Div2007\Api\Frontend::class); - // If any record registration is submitted, register the record. - $api->record_registration($recs, $GLOBALS['TYPO3_CONF_VARS']['FE']['maxSessionDataSize']); + if (TYPO3_MODE == 'FE') { + $recs = GeneralUtility::_GP('recs'); + + if ( + is_array($recs) && + $conf['transmissionSecurity'] + ) { + $errorCode = array(); + $errorMessage = ''; + $security = GeneralUtility::makeInstance(\JambageCom\Div2007\Security\TransmissionSecurity::class); + $decryptionResult = $security->decryptIncomingFields( + $recs, + $errorCode, + $errorMessage + ); + } + + if (is_array($recs)) { + $api = GeneralUtility::makeInstance( \JambageCom\Div2007\Api\Frontend::class); + // If any record registration is submitted, register the record. + $api->record_registration( + $recs, + $GLOBALS['TYPO3_CONF_VARS']['FE']['maxSessionDataSize'], + $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TT_PRODUCTS_EXT]['checkCookies'] + ); + } + $recs = tx_ttproducts_control_basket::getStoredRecs(); } - $recs = tx_ttproducts_control_basket::getStoredRecs(); + if (empty($recs)) { $recs = array(); } @@ -117,7 +124,7 @@ public function printContent () { } - public function &fetchRow ($data) { + public function fetchRow ($data) { $rc = ''; $view = ''; $rowArray = array(); @@ -243,7 +250,7 @@ public function &fetchRow ($data) { } - protected function &generateResponse ($view, &$rowArray, &$variantArray) { + protected function generateResponse ($view, &$rowArray, &$variantArray) { $csConvObj = $GLOBALS['TSFE']->csConvObj; $theCode = strtoupper($view); diff --git a/ext_conf_template.txt b/ext_conf_template.txt index 089e2fce7..aed7fd555 100755 --- a/ext_conf_template.txt +++ b/ext_conf_template.txt @@ -2,6 +2,8 @@ pageAsCategory = 0 # cat=basic/enable; type=string; label=Address table: Name of the address table to be used in the backend. The usage of the 'fe_users' table is recommended. addressTable = + # cat=basic/enable; type=boolean; label=Check Cookies: If set then the data inserted into the shopping basket or user data is only stored in a session if another extension allows to set the cookies. +checkCookies = 0 # cat=basic/enable; type=string; label=Image upload folder: This is the place where the images lie. imageFolder = uploads/pics # cat=basic/enable; type=string; label=Order tables by sorting: Enter a comma separated list of tt_products table names where the items should be listed by sorting in the backend diff --git a/ext_emconf.php b/ext_emconf.php index fa76917a3..f22bdd994 100755 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -18,7 +18,7 @@ 'version' => '2.9.6', 'constraints' => array( 'depends' => array( - 'div2007' => '1.10.24-0.0.0', + 'div2007' => '1.10.25-0.0.0', 'php' => '5.6.0-7.2.99', 'table' => '0.7.0-0.0.0', 'tsparser' => '0.2.5-0.0.0', diff --git a/view/class.tx_ttproducts_relatedlist_view.php b/view/class.tx_ttproducts_relatedlist_view.php index cc5215d20..cecab303e 100755 --- a/view/class.tx_ttproducts_relatedlist_view.php +++ b/view/class.tx_ttproducts_relatedlist_view.php @@ -225,7 +225,7 @@ public function getListMarkerArray ( 'functablename' => $functablename, 'uid' => $uid ); - $tmpContent = $listView->printView ( + $tmpContent = $listView->printView( $templateCode, $funcArray['code'], $funcArray['functablename'],