Skip to content

Commit

Permalink
Fix some warnings (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
digedag authored Jul 11, 2024
1 parent 08aecb5 commit ab594a4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog

v1.18.1 (??.??.2024)
* Improve page config setup in backend
* Fix PHP warnings

v1.18.0 (09.12.2023)

Expand Down
3 changes: 2 additions & 1 deletion Classes/Database/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Sys25\RnBase\Database;

use Countable;
use mysqli_result;
use PDO;
use Sys25\RnBase\Backend\Utility\TCA;
Expand Down Expand Up @@ -148,7 +149,7 @@ public function doSelect($what, $from, $arr, $debug = false)

if ($debug) {
Debug::debug([
'Rows retrieved ' => count($rows),
'Rows retrieved ' => $rows instanceof Countable ? $rows->count() : count($rows),
'Time ' => (microtime(true) - $time),
'Memory consumed ' => (memory_get_usage() - $mem),
'QB used' => is_object($queryBuilder),
Expand Down
11 changes: 8 additions & 3 deletions Classes/Utility/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2012-2023 Rene Nitzsche ([email protected])
* (c) 2012-2024 Rene Nitzsche ([email protected])
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand All @@ -33,6 +33,7 @@

/**
* Wrapper for language usage.
* Muss komplett überarbeitet werden. Da sind viele fragwürdige Dinge enthalten.
*
* @author Rene Nitzsche
*/
Expand Down Expand Up @@ -185,10 +186,14 @@ protected function loadLLOverlay46($confLL)
$this->LOCAL_LANG[$languageKey][$labelKey][0]['target'] = $labelValue;
// For labels coming from the TypoScript (database) the charset is assumed to be "forceCharset"
// and if that is not set, assumed to be that of the individual system languages
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) {
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] ?? false) {
$this->LOCAL_LANG_charset[$languageKey][$labelKey] = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'];
} else {
$this->LOCAL_LANG_charset[$languageKey][$labelKey] = $GLOBALS['TSFE']->csConvObj->charSetArray[$languageKey];
// FIXME: verhindert zunächst nur Warnungen. Muss aber eh komplett überarbeitet werden
$csConvObj = $GLOBALS['TSFE']->csConvObj;
if ($csConvObj && isset($csConvObj->charSetArray[$languageKey])) {
$this->LOCAL_LANG_charset[$languageKey][$labelKey] = $csConvObj->charSetArray[$languageKey];
}
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Classes/Utility/TSFAL.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2013-2023 Rene Nitzsche
* (c) 2013-2024 Rene Nitzsche
* Contact: [email protected]
* All rights reserved
*
Expand Down Expand Up @@ -323,10 +323,10 @@ public function fetchFirstReference($content, $configuration)
{
$contentObject = $this->cObj;

if ($configuration['refUid'] || $configuration['refUid.']) {
$uid = intval($contentObject->stdWrap($configuration['refUid'], $configuration['refUid.']));
if (isset($configuration['refUid']) || isset($configuration['refUid.'])) {
$uid = intval($contentObject->stdWrap($configuration['refUid'] ?? '', $configuration['refUid.'] ?? []));
} else {
$uid = $contentObject->data['_LOCALIZED_UID'] ? $contentObject->data['_LOCALIZED_UID'] : $contentObject->data['uid'];
$uid = $contentObject->data['_LOCALIZED_UID'] ?? $contentObject->data['uid'];
}
$refTable = ($configuration['refTable'] && is_array($GLOBALS['TCA'][$configuration['refTable']])) ?
$configuration['refTable'] : 'tt_content';
Expand Down

0 comments on commit ab594a4

Please sign in to comment.