Skip to content

Commit

Permalink
Merge pull request #301 from franzholz/develop
Browse files Browse the repository at this point in the history
breaking #92118: remove thumbnail
  • Loading branch information
franzholz authored Oct 12, 2024
2 parents 44edb57 + 25f4fc9 commit b5ba903
Show file tree
Hide file tree
Showing 45 changed files with 1,221 additions and 201 deletions.
1 change: 0 additions & 1 deletion Classes/Api/ActivityApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public function init($codes = []): void
$payment = $parameterApi->getParameter('products_payment') || $parameterApi->getParameter('products_payment_x');

$gpVars = $parameterApi->getParameter(TT_PRODUCTS_EXT);
debug($gpVars, '$gpVars');

if (
!$update &&
Expand Down
6 changes: 0 additions & 6 deletions Classes/Api/CustomerApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Utility\GeneralUtility;

abstract class CustomerTypes
{
public const Billing = 1;
public const Delivery = 2;
}

class CustomerApi
{
private static $billingInfo;
Expand Down
9 changes: 5 additions & 4 deletions Classes/Api/EditVariantApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ public function getMarkerArray(
$config,
&$markerArray
): void {
$flags = null;
$parameterApi = GeneralUtility::makeInstance(ParameterApi::class);

if (isset($config) && is_array($config)) {
Expand Down Expand Up @@ -368,7 +369,7 @@ public function getMarkerArray(
$theCode
);
$pat_attributes = '(\S+)=(("|\')(.| )*("|\')|(.* ))';
preg_match_all("@$pat_attributes@isU", $mainAttributes, $matches);
preg_match_all("@$pat_attributes@isU", (string)$mainAttributes, $matches);
$mainAttributesArray = [];
$matchArray = [];
if (is_array($matches)) {
Expand All @@ -380,7 +381,7 @@ public function getMarkerArray(
$lastAttribute = '';

foreach ($matchArray as $splitItem) {
$splitItemArray = explode('=', $splitItem);
$splitItemArray = explode('=', (string)$splitItem);
$parameterKey = strtolower($splitItemArray['0']);
$parameterValue = '';
if (isset($splitItemArray['1'])) {
Expand Down Expand Up @@ -411,7 +412,7 @@ public function getMarkerArray(
} else {
$html = '';
if (isset($row[$field])) {
$html = htmlspecialchars($row[$field], $flags);
$html = htmlspecialchars((string) $row[$field], $flags);
}
}

Expand Down Expand Up @@ -484,7 +485,7 @@ public function getSubpartMarkerArray(
}

foreach ($tagArray as $tag => $number) {
if (strpos($tag, 'edit_variant') === 0) {
if (str_starts_with($tag, 'edit_variant')) {
if (
!isset($subpartArray['###' . $tag . '###']) &&
!isset($wrappedSubpartArray['###' . $tag . '###'])
Expand Down
2 changes: 1 addition & 1 deletion Classes/Api/FeUserMarkerApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getWrappedSubpartArray(
$markerLogin = 'LOGIN';
$markerNologin = 'NOLOGIN';
foreach ($viewTagArray as $tag => $value) {
if (strpos($tag, $marker . '_') === 0) {
if (str_starts_with((string)$tag, $marker . '_')) {
$tagPart1 = substr($tag, strlen($marker . '_'));
$offset = strpos($tagPart1, '_TEMPLATE');
if ($offset > 0) {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Api/ParameterApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ public function getSearchInfo(
$foundKey = 0;

if ($position == 'local' && isset($keyFieldArray[$searchFieldArray['local']]) && ExtensionManagementUtility::isLoaded('searchbox')) { // Todo
require_once PATH_BE_searchbox . 'model/class.tx_searchbox_model.php';
require_once \PATH_BE_SEARCHBOX . 'model/class.tx_searchbox_model.php';
$modelObj = GeneralUtility::makeInstance('tx_searchbox_model');

$fullKeyFieldArray = $modelObj->getKeyFieldArray($tablename, '', '-', $searchFieldArray['local'], '1', $tmpCount);
Expand Down
6 changes: 3 additions & 3 deletions Classes/Api/PaymentGatewayApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

class PaymentGatewayApi implements SingletonInterface
{
public const TRANSACTOR_EXTENSION = 'transactor';
final public const TRANSACTOR_EXTENSION = 'transactor';
protected $handleScript = '';
protected $handleLib = '';
protected $handleLibConf = [];
Expand Down Expand Up @@ -249,8 +249,8 @@ class_exists(Address::class)
$parameters
);
$extraData = [
'return_url' => $returnUrl,
'cancel_url' => $cancelUrl,
'return_url' => rtrim($returnUrl, '/'),
'cancel_url' => rtrim($cancelUrl, '/'),
];
$parameters = [
&$errorMessage,
Expand Down
6 changes: 3 additions & 3 deletions Classes/Api/PaymentShippingHandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ public static function generateRadioSelect(

$actTitle = $localBasketExtra['title'] ?? '';
$confArray = static::cleanConfArr($confArray);
$bWrapSelect = (count($confArray) > 1);
$bWrapSelect = ((is_countable($confArray) ? count($confArray) : 0) > 1);

if (is_array($confArray)) {
foreach ($confArray as $key => $item) {
Expand Down Expand Up @@ -2046,8 +2046,8 @@ public static function getHandlingShipping(
$basketExtra[$pskey . '.'][$subkey] = $valueArray;
$basketExtra[$pskey . '.'][$subkey . '.'] = $confArray[$k . '.'] ?? [];
if ($pskey == 'shipping') {
$newExcludePayment = trim($basketExtra[$pskey . '.'][$subkey . '.']['excludePayment'] ?? '');
$newExcludeHandling = trim($basketExtra[$pskey . '.'][$subkey . '.']['excludeHandling'] ?? '');
$newExcludePayment = trim((string) ($basketExtra[$pskey . '.'][$subkey . '.']['excludePayment'] ?? ''));
$newExcludeHandling = trim((string) ($basketExtra[$pskey . '.'][$subkey . '.']['excludeHandling'] ?? ''));
}
} else {
$basketExtra[$pskey] = $valueArray;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Api/PluginApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public static function initConfig(

// get template suffix string

$config['templateSuffix'] = strtoupper($conf['templateSuffix'] ?? '');
$config['templateSuffix'] = strtoupper((string) ($conf['templateSuffix'] ?? ''));

$templateSuffix = FlexformUtility::get(self::getFlexform(), 'template_suffix');
$templateSuffix = strtoupper($templateSuffix);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controller/ActivityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ public function getErrorLabel(
if (!$languageKey) {
$languageKey = 'missing_' . $check;
}
$label = $GLOBALS['TSFE']->sL('LLL:EXT:sr_feuser_register' . $languageSubpath
$label = $GLOBALS['TSFE']->sL('LLL:EXT:sr_feuser_register' . $languageSubpath . 'locallang.xlf:' . $languageKey);
$editPID = 0;
if ($typo3VersionMain < 12) {
$editPID = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_srfeuserregister_pi1.']['editPID'] ?? 0;
Expand Down
10 changes: 5 additions & 5 deletions Classes/Utility/ImportFalUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ public static function importAll(
$content = '';
$pid = intval($currId);
$tableMediaArray = [
'tt_products' => ['image', 'smallimage'],
'tt_products_language' => ['image'],
'tt_products_cat' => ['image'],
'tt_products_articles' => ['image'],
'tt_products' => ['image', 'smallimage', 'datasheet'],
'tt_products_language' => ['image', 'smallimage', 'datasheet'],
'tt_products_cat' => ['image', 'sliderimage'],
'tt_products_articles' => ['image', 'smallimage'],
];

foreach ($tableMediaArray as $tablename => $imageFieldnameArray) {
Expand All @@ -98,7 +98,7 @@ public static function importAll(
// if ($k != 3) continue; // Test

if (!empty($row[$imageFieldname])) {
$imageArray = explode(',', $row[$imageFieldname]);
$imageArray = explode(',', (string) $row[$imageFieldname]);
$sysfileRowArray = [];
if (intval($row[$imageFalFieldname]) != 0) {
$where_clause = 'uid_foreign=' . intval($row['uid']) . ' AND tablenames="' . $tablename . '" AND fieldname="' . $imageFalFieldname . '"';
Expand Down
7 changes: 6 additions & 1 deletion Configuration/Icons.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<?php
use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider;

return [
'tt-products-wizard' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
'provider' => BitmapIconProvider::class,
// The source bitmap file
'source' => 'EXT:tt_products/Resources/Public/Icons/PluginWizard.png',
],
'tt-products-product' => [
'provider' => BitmapIconProvider::class,
'source' => 'EXT:tt_products/Resources/Public/Icons/tt_products.gif',
]
];
18 changes: 18 additions & 0 deletions Configuration/TCA/Overrides/Plugins/list.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types = 1);

(static function (): void {
$selectItemArray = new \TYPO3\CMS\Core\Schema\Struct\SelectItem(
'select',
'LLL:EXT:tt_products/Resources/Private/Language/Pi1/locallang.xlf:plugin',
'tx_ttproducts_pi1',
'',
'tt_products'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
$selectItemArray,
'CType',
'tx_ttproducts_pi1'
);
})();
Loading

0 comments on commit b5ba903

Please sign in to comment.