From f29d236c2d666ea14fd00b30f790bb9b729e0f45 Mon Sep 17 00:00:00 2001 From: Franz Holzinger Date: Wed, 25 Sep 2024 10:20:21 +0200 Subject: [PATCH 1/4] next version 2.15.15 --- ext_emconf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext_emconf.php b/ext_emconf.php index a72f6a9af..10583f535 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -6,7 +6,7 @@ 'title' => 'Shop System', 'description' => 'Advanced versions at ttproducts.de. Documented in the E-Book "Der TYPO3-Webshop" - Shop with listing in multiple languages, with order tracking, product variants, support for transactor extension, bill, creditpoint and voucher system.', 'state' => 'stable', - 'version' => '2.15.14', + 'version' => '2.15.15', 'manual' => true, 'author' => 'Franz Holzinger', 'author_company' => 'jambage.com', From 87b39e51a4517e092797d1e18cbba80e7624bee7 Mon Sep 17 00:00:00 2001 From: Franz Holzinger Date: Fri, 27 Sep 2024 11:06:13 +0200 Subject: [PATCH 2/4] add method getTagId --- Classes/Api/ControlApi.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Classes/Api/ControlApi.php b/Classes/Api/ControlApi.php index b13aaf08e..b75f76b20 100644 --- a/Classes/Api/ControlApi.php +++ b/Classes/Api/ControlApi.php @@ -79,4 +79,15 @@ public static function isOverwriteMode($infoArray) return $overwriteMode; } + + public static function getTagId( + $jsTableNamesId, + $theCode, + $uid, + $field + ) { + $result = $jsTableNamesId . '-' . strtolower($theCode) . '-' . $uid . '-' . $field; + + return $result; + } } From c682e5bc1c3aedb8e92e9ae038470572aa0efd8d Mon Sep 17 00:00:00 2001 From: Franz Holzinger Date: Fri, 27 Sep 2024 11:08:22 +0200 Subject: [PATCH 3/4] fix issue with missing image setup --- view/class.tx_ttproducts_table_base_view.php | 12 ++++++------ view/field/class.tx_ttproducts_field_media_view.php | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/view/class.tx_ttproducts_table_base_view.php b/view/class.tx_ttproducts_table_base_view.php index f31d9d1bf..cac242103 100644 --- a/view/class.tx_ttproducts_table_base_view.php +++ b/view/class.tx_ttproducts_table_base_view.php @@ -485,14 +485,14 @@ public function getId($row, $midId, $theCode) // This can also add additional fields to the row. public function modifyFieldObject( + &$theMarkerArray, array $origRow, array $row, array $tableconf, $markerPrefix, $suffix, array $fieldMarkerArray, - array $markerArray, - &$theMarkerArray + array $markerArray ) { $templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class); $local_cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class); @@ -533,7 +533,8 @@ public function modifyFieldObject( $hookObj = GeneralUtility::makeInstance($classRef); if (method_exists($hookObj, 'modifyFieldObject')) { $hookObj->modifyFieldObject( - $thts, + $theMarkerArray, + $this, $origRow, $row, $tableconf, @@ -541,7 +542,6 @@ public function modifyFieldObject( $suffix, $fieldMarkerArray, $markerArray, - $theMarkerArray, $newRow ); } @@ -720,14 +720,14 @@ public function getRowMarkerArray( } if (!$bSkip) { $this->modifyFieldObject( + $theMarkerArray, $row, $modifiedRow, $tableconf, $markerPrefix, $suffix, $fieldMarkerArray, - $markerArray, - $theMarkerArray + $markerArray ); } } diff --git a/view/field/class.tx_ttproducts_field_media_view.php b/view/field/class.tx_ttproducts_field_media_view.php index f974b0b09..8d3177ca1 100644 --- a/view/field/class.tx_ttproducts_field_media_view.php +++ b/view/field/class.tx_ttproducts_field_media_view.php @@ -289,7 +289,10 @@ public function getCodeMarkerArray( if (is_array($tableConf) && isset($tableConf['imageMarker.'])) { $imageMarkerArray = $tableConf['imageMarker.']; } - $imageConfStart = $this->conf[$imageRenderObj . '.']; + $imageConfStart = $this->conf[$imageRenderObj . '.'] ?? null; + if (!isset($imageConfStart)) { + return false; + } $contentObject = $this->conf[$imageRenderObj] ?? ''; if ($contentObject == '') { $contentObject = 'IMAGE'; From 97c3e36293c09742378a6b9119958548f2f5c791 Mon Sep 17 00:00:00 2001 From: Franz Holzinger Date: Fri, 27 Sep 2024 11:12:19 +0200 Subject: [PATCH 4/4] fix continue statements --- Classes/Api/CreditpointsViewApi.php | 2 +- Classes/Api/EditVariantApi.php | 2 +- Classes/Api/PaymentShippingHandling.php | 4 ++-- eid/class.tx_ttproducts_db.php | 13 ++++++++----- lib/class.tx_ttproducts_csv.php | 2 +- lib/class.tx_ttproducts_discountprice.php | 8 ++++---- lib/class.tx_ttproducts_pricecalc.php | 4 ++-- model/class.tx_ttproducts_basket.php | 2 +- model/class.tx_ttproducts_fpdf.php | 6 +++--- model/class.tx_ttproducts_order.php | 2 +- model/class.tx_ttproducts_pdf.php | 6 +++--- model/class.tx_ttproducts_product.php | 6 +++++- view/class.tx_ttproducts_basketitem_view.php | 2 +- view/class.tx_ttproducts_product_view.php | 2 +- 14 files changed, 34 insertions(+), 27 deletions(-) diff --git a/Classes/Api/CreditpointsViewApi.php b/Classes/Api/CreditpointsViewApi.php index 74680d97a..11bdf9637 100644 --- a/Classes/Api/CreditpointsViewApi.php +++ b/Classes/Api/CreditpointsViewApi.php @@ -79,7 +79,7 @@ public function getItemMarkerSubpartArrays( foreach ($actItemArray as $k1 => $actItem) { $row = $actItem['rec']; if (!$row) { // avoid bug with missing row - continue 2; + continue 1; } $pricecredits_total_totunits_no_tax = 0; $pricecredits_total_totunits_tax = 0; diff --git a/Classes/Api/EditVariantApi.php b/Classes/Api/EditVariantApi.php index cd0c4ba45..b27911d86 100644 --- a/Classes/Api/EditVariantApi.php +++ b/Classes/Api/EditVariantApi.php @@ -290,7 +290,7 @@ public function getVariables(array $editVariantConfig, array $row) ) { foreach ($config['setVariables.'] as $variable => $value) { if (strpos($variable, '.') !== false) { - continue 2; + continue 1; } $isActive = true; if ( diff --git a/Classes/Api/PaymentShippingHandling.php b/Classes/Api/PaymentShippingHandling.php index 040a19bd5..f0f84cbde 100644 --- a/Classes/Api/PaymentShippingHandling.php +++ b/Classes/Api/PaymentShippingHandling.php @@ -230,7 +230,7 @@ public static function getSubpartArrays( if ( !MathUtility::canBeInterpretedAsInteger($k2int) ) { - continue 2; + continue 1; } if ($pskey == 'handling') { @@ -240,7 +240,7 @@ public static function getSubpartArrays( if ( !MathUtility::canBeInterpretedAsInteger($k3int) ) { - continue 2; + continue 1; } $bActive = isset($basketExtra[$pskey . '.'][$k3int]['0']) && ($k3int == $basketExtra[$pskey . '.'][$k3int]['0']); self::helperSubpartArray( diff --git a/eid/class.tx_ttproducts_db.php b/eid/class.tx_ttproducts_db.php index 2667aa4dc..d96ce3b81 100644 --- a/eid/class.tx_ttproducts_db.php +++ b/eid/class.tx_ttproducts_db.php @@ -536,7 +536,7 @@ protected function generateResponse( ) || $field == 'additional' ) { - continue 2; + continue 1; } $fieldId = $field; $bSkip = false; @@ -592,7 +592,7 @@ protected function generateResponse( if (!in_array($field, $variantArray)) { if (($position = strpos($field, '_uid')) !== false) { if (!$useFal) { - continue 2; + continue 1; } $fieldId = substr($field, 0, $position); } else { @@ -600,7 +600,7 @@ protected function generateResponse( in_array($field, ['image', 'smallimage']) && $useFal ) { - continue 2; + continue 1; } } @@ -681,7 +681,11 @@ protected function generateResponse( $mediaNum ); - $v = $imgCodeArray; + if (is_array($imgCodeArray)) { + $v = $imgCodeArray; + } else { + continue 2; + } } else { $v = ''; continue 2; // do not delete the current image @@ -736,7 +740,6 @@ protected function generateResponse( $fieldMarkerArray, $markerArray ); - foreach ($newRow as $field => $v) { $tagId = ControlApi::getTagId( $jsTableNamesId, diff --git a/lib/class.tx_ttproducts_csv.php b/lib/class.tx_ttproducts_csv.php index 54d4f9e0b..539c446b2 100644 --- a/lib/class.tx_ttproducts_csv.php +++ b/lib/class.tx_ttproducts_csv.php @@ -151,7 +151,7 @@ public function create( $pid = intval($row['pid']); if (!tx_ttproducts_control_basket::getPidListObj()->getPageArray($pid)) { // product belongs to another basket - continue 2; + continue 1; } // $variants = explode(';', $itemTable->variant->getVariantFromRow($row)); $csvdata = '"' . intval($row['uid']) . '";"' . diff --git a/lib/class.tx_ttproducts_discountprice.php b/lib/class.tx_ttproducts_discountprice.php index 97417b5f6..b6bf36fc0 100644 --- a/lib/class.tx_ttproducts_discountprice.php +++ b/lib/class.tx_ttproducts_discountprice.php @@ -143,7 +143,7 @@ public function getCalculatedData( $additive = $v2; break; } - continue 2; + continue 1; } } if (isset($priceCalcTemp['prod.']) && is_array($priceCalcTemp['prod.'])) { @@ -183,7 +183,7 @@ public function getCalculatedData( if (is_array($priceCalcTemp['sql.'])) { if (!($bIsValid = tx_ttproducts_sql::isValid($row, $priceCalcTemp['sql.']['where']))) { - continue 2; + continue 1; } } @@ -320,7 +320,7 @@ public function getCalculatedData( ) { $rangeArray = GeneralUtility::trimExplode(',', $rangeConf['range']); if (count($rangeArray) != count($fieldArray)) { - continue 3; + continue 1; } $k3number = substr($k3, 0, -1); @@ -456,7 +456,7 @@ public function getCalculatedData( if (is_array($countedItems[$k1])) { foreach ($countedItems[$k1] as $k3 => $v3) { if ($v3['active'] == false) { - continue 2; + continue 1; } foreach ($itemArray[$v3['sort']] as $k1 => $actItem) { diff --git a/lib/class.tx_ttproducts_pricecalc.php b/lib/class.tx_ttproducts_pricecalc.php index 95f26eacf..2355ac3db 100644 --- a/lib/class.tx_ttproducts_pricecalc.php +++ b/lib/class.tx_ttproducts_pricecalc.php @@ -75,13 +75,13 @@ public function getCalculatedData( if (is_array($priceCalcTemp['sql.'])) { if (!($bIsValid = $sql->isValid($row, $priceCalcTemp['sql.']['where']))) { - continue 2; + continue 1; } } // has a price reduction already been calculated before ? if ($priceReduction[$row['uid']] == 1) { - continue 2; + continue 1; } // count all items which will apply to the discount price diff --git a/model/class.tx_ttproducts_basket.php b/model/class.tx_ttproducts_basket.php index 1e4b4121c..35d00f9fc 100644 --- a/model/class.tx_ttproducts_basket.php +++ b/model/class.tx_ttproducts_basket.php @@ -1468,7 +1468,7 @@ public function create( if ($conf['whereGiftService']) { $bAddGiftService = true; } - continue 2; + continue 1; } $currRow = diff --git a/model/class.tx_ttproducts_fpdf.php b/model/class.tx_ttproducts_fpdf.php index 13fb609e8..c6ae104b1 100644 --- a/model/class.tx_ttproducts_fpdf.php +++ b/model/class.tx_ttproducts_fpdf.php @@ -152,7 +152,7 @@ public function ImprovedTable($header, array $data): void if ($k2 == 0 && trim($v2) == '' && $rowCount == 4 && $oldRowCount == 1 && $columnNo == 2) { // skip first column which has been filled in from former row - continue 2; + continue 1; } $l2 = intval($this->GetStringWidth($v2)); unset($value); @@ -198,11 +198,11 @@ public function ImprovedTable($header, array $data): void $columnNo++; if ($columnNo <= 4) { - continue 2; + continue 1; } $this->Ln(); } else { - continue 2; + continue 1; } if (isset($additonalRow) && is_array($additonalRow)) { diff --git a/model/class.tx_ttproducts_order.php b/model/class.tx_ttproducts_order.php index e3f03d488..d274928c9 100644 --- a/model/class.tx_ttproducts_order.php +++ b/model/class.tx_ttproducts_order.php @@ -679,7 +679,7 @@ public function createMM( if (!tx_ttproducts_control_basket::getPidListObj()->getPageArray($pid)) { // product belongs to another basket - continue 2; + continue 1; } $variantArray = []; diff --git a/model/class.tx_ttproducts_pdf.php b/model/class.tx_ttproducts_pdf.php index 3163b778c..c9a9873e4 100644 --- a/model/class.tx_ttproducts_pdf.php +++ b/model/class.tx_ttproducts_pdf.php @@ -154,7 +154,7 @@ public function ImprovedTable($header, array $data): void if ($k2 == 0 && trim($v2) == '' && $rowCount == 4 && $oldRowCount == 1 && $columnNo == 2) { // skip first column which has been filled in from former row - continue 2; + continue 1; } $l2 = intval($this->GetStringWidth($v2)); unset($value); @@ -200,11 +200,11 @@ public function ImprovedTable($header, array $data): void $columnNo++; if ($columnNo <= 4) { - continue 2; + continue 1; } $this->Ln(); } else { - continue 2; + continue 1; } if (isset($additonalRow) && is_array($additonalRow)) { diff --git a/model/class.tx_ttproducts_product.php b/model/class.tx_ttproducts_product.php index 8a5d59415..2aa802ede 100644 --- a/model/class.tx_ttproducts_product.php +++ b/model/class.tx_ttproducts_product.php @@ -157,6 +157,7 @@ public function fillVariantsFromArticles( foreach ($selectableFieldArray as $field) { if ( + isset($row[$field]) && $row[$field] == '' && !empty($variantRow[$field]) ) { @@ -215,7 +216,10 @@ public function getMatchingArticleRows( foreach ($fieldArray as $field => $valueArray) { $valueArray = array_map('trim', $valueArray); $rowFieldArray = []; - if (isset($row[$field]) && strlen($row[$field])) { + if ( + isset($row[$field]) && + strlen($row[$field]) + ) { $rowFieldArray = preg_split( '/[\h]*' . $variantSeparator . '[\h]*/', diff --git a/view/class.tx_ttproducts_basketitem_view.php b/view/class.tx_ttproducts_basketitem_view.php index 8add62d42..406ad2d23 100644 --- a/view/class.tx_ttproducts_basketitem_view.php +++ b/view/class.tx_ttproducts_basketitem_view.php @@ -449,7 +449,7 @@ public function getItemMarkerArray( $imageImport['sql.']['where'] ); if (!$bIsValid) { - continue 2; + continue 1; } } $imageFile = $imageImport['prod.'][$k2]; diff --git a/view/class.tx_ttproducts_product_view.php b/view/class.tx_ttproducts_product_view.php index 76bd61034..60113bdcc 100644 --- a/view/class.tx_ttproducts_product_view.php +++ b/view/class.tx_ttproducts_product_view.php @@ -334,7 +334,7 @@ public function getModelMarkerArray( } } if (strpos($index, $markerKey) === false) { - continue 3; + continue 1; } $fieldPos = strrpos($index, '_'); $fieldName = substr($index, $fieldPos + 1);