diff --git a/Classes/Controller/ActivityController.php b/Classes/Controller/ActivityController.php index 8de8dd3fc..4f2088ec6 100644 --- a/Classes/Controller/ActivityController.php +++ b/Classes/Controller/ActivityController.php @@ -90,6 +90,7 @@ class ActivityController implements SingletonInterface public function init($pibaseClass, $funcTablename, $useArticles): void { $this->pibaseClass = $pibaseClass; + $pibaseObj = GeneralUtility::makeInstance('' . $this->pibaseClass); $this->cObj = $pibaseObj->getContentObjectRenderer(); $cnf = GeneralUtility::makeInstance('tx_ttproducts_config'); $this->conf = $cnf->conf; diff --git a/Configuration/TCA/sys_products_orders.php b/Configuration/TCA/sys_products_orders.php index e96fce059..ffcdb0f60 100644 --- a/Configuration/TCA/sys_products_orders.php +++ b/Configuration/TCA/sys_products_orders.php @@ -106,7 +106,6 @@ 'generatorOptions' => [ 'fields' => ['name', 'crdate'], 'fieldSeparator' => '_', - 'prefixParentPageSlug' => false, 'replacements' => [ '/' => '-', ], diff --git a/Configuration/TCA/tt_products.php b/Configuration/TCA/tt_products.php index e880d8c91..aad96bd2c 100644 --- a/Configuration/TCA/tt_products.php +++ b/Configuration/TCA/tt_products.php @@ -158,7 +158,6 @@ 'generatorOptions' => [ 'fields' => ['title', 'itemnumber'], 'fieldSeparator' => '_', - 'prefixParentPageSlug' => false, 'replacements' => [ '/' => '-', ], diff --git a/Configuration/TCA/tt_products_articles.php b/Configuration/TCA/tt_products_articles.php index 104f7dbbf..f9e3a1993 100644 --- a/Configuration/TCA/tt_products_articles.php +++ b/Configuration/TCA/tt_products_articles.php @@ -152,7 +152,6 @@ 'generatorOptions' => [ 'fields' => ['title', 'itemnumber'], 'fieldSeparator' => '_', - 'prefixParentPageSlug' => false, 'replacements' => [ '/' => '-', ], diff --git a/Configuration/TCA/tt_products_articles_language.php b/Configuration/TCA/tt_products_articles_language.php index dae25a931..ebade5c91 100644 --- a/Configuration/TCA/tt_products_articles_language.php +++ b/Configuration/TCA/tt_products_articles_language.php @@ -179,7 +179,6 @@ 'generatorOptions' => [ 'fields' => ['title', 'article_uid'], 'fieldSeparator' => '_', - 'prefixParentPageSlug' => false, 'replacements' => [ '/' => '-', ], diff --git a/Configuration/TCA/tt_products_cat.php b/Configuration/TCA/tt_products_cat.php index 0a483a655..f1cbbee36 100644 --- a/Configuration/TCA/tt_products_cat.php +++ b/Configuration/TCA/tt_products_cat.php @@ -151,7 +151,6 @@ 'generatorOptions' => [ 'fields' => ['title', 'catid'], 'fieldSeparator' => '_', - 'prefixParentPageSlug' => false, 'replacements' => [ '/' => '-', ], diff --git a/Configuration/TCA/tt_products_cat_language.php b/Configuration/TCA/tt_products_cat_language.php index 4a6c5a783..2bb0102ab 100644 --- a/Configuration/TCA/tt_products_cat_language.php +++ b/Configuration/TCA/tt_products_cat_language.php @@ -161,7 +161,6 @@ 'generatorOptions' => [ 'fields' => ['title', 'cat_uid'], 'fieldSeparator' => '_', - 'prefixParentPageSlug' => false, 'replacements' => [ '/' => '-', ], diff --git a/Configuration/TCA/tt_products_downloads.php b/Configuration/TCA/tt_products_downloads.php index aa8055353..6ebf85ab8 100644 --- a/Configuration/TCA/tt_products_downloads.php +++ b/Configuration/TCA/tt_products_downloads.php @@ -137,7 +137,6 @@ 'generatorOptions' => [ 'fields' => ['title', 'author'], 'fieldSeparator' => '_', - 'prefixParentPageSlug' => false, 'replacements' => [ '/' => '-', ], diff --git a/Configuration/TCA/tt_products_downloads_language.php b/Configuration/TCA/tt_products_downloads_language.php index e724c03be..7a7d9f6ae 100644 --- a/Configuration/TCA/tt_products_downloads_language.php +++ b/Configuration/TCA/tt_products_downloads_language.php @@ -147,7 +147,6 @@ 'generatorOptions' => [ 'fields' => ['title', 'parent_uid'], 'fieldSeparator' => '_', - 'prefixParentPageSlug' => false, 'replacements' => [ '/' => '-', ], diff --git a/Configuration/TCA/tt_products_language.php b/Configuration/TCA/tt_products_language.php index 25aaca2c6..2b6fac9e5 100644 --- a/Configuration/TCA/tt_products_language.php +++ b/Configuration/TCA/tt_products_language.php @@ -180,7 +180,6 @@ 'generatorOptions' => [ 'fields' => ['title', 'itemnumber'], 'fieldSeparator' => '_', - 'prefixParentPageSlug' => false, 'replacements' => [ '/' => '-', ], diff --git a/ext_tables.sql b/ext_tables.sql index 3b859af20..bf3acca22 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -23,7 +23,7 @@ CREATE TABLE tt_products ( fe_group varchar(255) DEFAULT '0' NOT NULL, title tinytext, subtitle mediumtext, - slug varchar(2048), + slug varchar(2048) DEFAULT '' NOT NULL, keyword mediumtext, prod_uid int(11) DEFAULT '0' NOT NULL, accessory_uid int(11) DEFAULT '0' NOT NULL, @@ -256,7 +256,7 @@ CREATE TABLE tt_products_cat ( fe_group varchar(255) DEFAULT '0' NOT NULL, title tinytext, subtitle mediumtext, - slug varchar(2048), + slug varchar(2048) DEFAULT '' NOT NULL, catid varchar(40) DEFAULT '' NOT NULL, keyword mediumtext, note text, @@ -304,7 +304,7 @@ CREATE TABLE tt_products_cat_language ( fe_group varchar(255) DEFAULT '0' NOT NULL, title tinytext, subtitle mediumtext, - slug varchar(2048), + slug varchar(2048) DEFAULT '' NOT NULL, keyword mediumtext, note text, note2 text, @@ -365,7 +365,7 @@ CREATE TABLE tt_products_articles ( fe_group varchar(255) DEFAULT '0' NOT NULL, title varchar(80) DEFAULT '' NOT NULL, subtitle varchar(80) DEFAULT '' NOT NULL, - slug varchar(2048), + slug varchar(2048) DEFAULT '' NOT NULL, keyword mediumtext, itemnumber varchar(120) DEFAULT '' NOT NULL, price decimal(19,2) DEFAULT '0.00' NOT NULL, @@ -432,7 +432,7 @@ CREATE TABLE tt_products_articles_language ( fe_group varchar(255) DEFAULT '0' NOT NULL, title varchar(80) DEFAULT '' NOT NULL, subtitle varchar(80) DEFAULT '' NOT NULL, - slug varchar(2048), + slug varchar(2048) DEFAULT '' NOT NULL, keyword mediumtext, article_uid int(11) DEFAULT '0' NOT NULL, note text, @@ -759,7 +759,7 @@ CREATE TABLE tt_products_downloads ( endtime int(11) DEFAULT '0' NOT NULL, fe_group varchar(255) DEFAULT '0' NOT NULL, title tinytext, - slug varchar(2048), + slug varchar(2048) DEFAULT '' NOT NULL, marker varchar(255) DEFAULT '' NOT NULL, note text, path varchar(255) DEFAULT '' NOT NULL, @@ -815,7 +815,7 @@ CREATE TABLE tt_products_downloads_language ( fe_group varchar(255) DEFAULT '0' NOT NULL, parent_uid int(11) DEFAULT '0' NOT NULL, title tinytext, - slug varchar(2048), + slug varchar(2048) DEFAULT '' NOT NULL, note text, PRIMARY KEY (uid), @@ -877,7 +877,7 @@ CREATE TABLE sys_products_orders ( name varchar(80) DEFAULT '' NOT NULL, first_name varchar(50) DEFAULT '' NOT NULL, last_name varchar(50) DEFAULT '' NOT NULL, - slug varchar(2048), + slug varchar(2048) DEFAULT '' NOT NULL, salutation int(11) DEFAULT '0' NOT NULL, company varchar(80) DEFAULT '' NOT NULL, vat_id varchar(20) DEFAULT '' NOT NULL, diff --git a/lib/class.tx_ttproducts_form_div.php b/lib/class.tx_ttproducts_form_div.php index 7dcf8aa4f..11b6366dd 100644 --- a/lib/class.tx_ttproducts_form_div.php +++ b/lib/class.tx_ttproducts_form_div.php @@ -74,8 +74,19 @@ public static function createSelect( foreach ($valueArray as $key => $parts) { if (is_array($parts)) { - $selectKey = $parts['value']; - $selectValue = $parts['label']; + if ( + isset($parts['value']) && + isset($parts['label']) + ) { + $selectKey = $parts['value']; + $selectValue = $parts['label']; + } else if ( + isset($parts['0']) && + isset($parts['1']) + ) { + $selectKey = $parts['1']; + $selectValue = $parts['0']; + } } else { $selectKey = $key; $selectValue = $parts; @@ -125,12 +136,22 @@ public static function createSelect( switch ($type) { case 'select': - $inputTextArray = ['']; + $inputTextArray = [ + '' + ]; break; case 'checkbox': case 'radio': $preParamArray['type'] = $type; - $inputText = self::createTag('input', $name, $valueText, $preParamArray, $paramArray); + $inputText = + self::createTag( + 'input', + $name, + $valueText, + $preParamArray, + $paramArray + ); if ($layout == '') { $inputText .= ' ' . $nameText . '
'; @@ -151,6 +172,7 @@ public static function createSelect( if (is_array($imageFileArray) && isset($imageFileArray[$key])) { $tmpText = str_replace('###IMAGE###', $imageFileArray[$key], $tmpText); } + if (is_array($keyMarkerArray) && isset($keyMarkerArray[$key])) { $tmpText = $templateService->substituteMarkerArray( $tmpText, diff --git a/model/class.tx_ttproducts_table_base.php b/model/class.tx_ttproducts_table_base.php index 71920d912..a435d2285 100644 --- a/model/class.tx_ttproducts_table_base.php +++ b/model/class.tx_ttproducts_table_base.php @@ -48,7 +48,7 @@ abstract class tx_ttproducts_table_base implements SingletonInterface public $conf; public $config; public $tableObj; // object of the type tx_table_db - public $defaultFieldArray = ['uid' => 'uid', 'pid' => 'pid']; // fields which must always be read in + public $defaultFieldArray = ['uid' => 'uid', 'pid' => 'pid', 'sorting' => 'sorting']; // fields which must always be read in public $relatedFromTableArray = []; public $fieldArray = []; // field replacements protected $insertRowArray; // array of stored insert records diff --git a/view/class.tx_ttproducts_list_view.php b/view/class.tx_ttproducts_list_view.php index 8cab0b8bd..694d9b418 100644 --- a/view/class.tx_ttproducts_list_view.php +++ b/view/class.tx_ttproducts_list_view.php @@ -1389,8 +1389,6 @@ public function printView( if (!$selectConf['orderBy']) { $selectConf['orderBy'] = $conf['orderBy']; } - $tmpArray = GeneralUtility::trimExplode(',', $selectConf['orderBy']); - $orderByArray[$funcTablename] = $tmpArray[0]; // $orderByProduct if ($useCategories) { $orderByCat = $tableConfArray[$categoryFuncTablename]['orderBy'];