4646use TYPO3 \CMS \Core \Database \Query \Restriction \DeletedRestriction ;
4747use TYPO3 \CMS \Core \Database \Query \Restriction \WorkspaceRestriction ;
4848use TYPO3 \CMS \Core \Database \ReferenceIndex ;
49- use TYPO3 \CMS \Core \Domain \Exception \RecordPropertyNotFoundException ;
5049use TYPO3 \CMS \Core \Domain \Persistence \RecordIdentityMap ;
5150use TYPO3 \CMS \Core \Domain \Record ;
5251use TYPO3 \CMS \Core \Domain \RecordFactory ;
@@ -813,7 +812,7 @@ public function getTable(string $table): string
813812 $ languageFieldName = $ schema ->isLanguageAware () ? $ schema ->getCapability (TcaSchemaCapability::Language)->getLanguageField ()->getName () : '' ;
814813 // Guard clause so we can quickly return if a record is localized to "all languages"
815814 // It should only be possible to localize a record off default (uid 0)
816- if ($ l10nEnabled && $ record ->getRawRecord ()->has ($ languageFieldName ) && (int )$ record ->getRawRecord ()->get ($ languageFieldName ) !== -1 ) {
815+ if ($ l10nEnabled && $ record ->getRawRecord ()? ->has($ languageFieldName ) && (int )$ record ->getRawRecord ()->get ($ languageFieldName ) !== -1 ) {
817816 $ translationsRaw = $ this ->translateTools ->translationInfo ($ table , $ record ->getUid (), 0 , $ record ->getRawRecord ()->toArray (), '* ' );
818817 if (is_array ($ translationsRaw )) {
819818 $ translationEnabled = true ;
@@ -1252,7 +1251,7 @@ public function renderListRow($table, RecordInterface $record, int $indent, arra
12521251 array_splice ($ this ->fieldArray , 0 , 1 );
12531252 }
12541253 } elseif ($ fCol === 'icon ' ) {
1255- $ rowArray = $ record ->getRawRecord ()->toArray ();
1254+ $ rowArray = $ record ->getRawRecord ()? ->toArray() ?? [] ;
12561255 $ icon = $ this ->iconFactory
12571256 ->getIconForRecord ($ table , $ rowArray , IconSize::SMALL )
12581257 ->setTitle (BackendUtility::getRecordIconAltText ($ record , $ table , false ))
@@ -1279,8 +1278,8 @@ public function renderListRow($table, RecordInterface $record, int $indent, arra
12791278 } elseif ($ fCol !== '_LOCALIZATION_b ' ) {
12801279 // default for all other columns, except "_LOCALIZATION_b"
12811280 $ pageId = $ table === 'pages ' ? $ record ->getUid () : $ record ->getPid ();
1282- $ fieldValue = $ record ->getRawRecord ()->has ($ fCol ) ? $ record ->getRawRecord ()->get ($ fCol ) : '' ;
1283- $ tmpProc = BackendUtility::getProcessedValueExtra ($ table , $ fCol , $ fieldValue , 100 , $ record ->getUid (), true , $ pageId , $ record ->getRawRecord ()->toArray ());
1281+ $ fieldValue = $ record ->getRawRecord ()? ->has($ fCol ) ? $ record ->getRawRecord ()->get ($ fCol ) : '' ;
1282+ $ tmpProc = BackendUtility::getProcessedValueExtra ($ table , $ fCol , $ fieldValue , 100 , $ record ->getUid (), true , $ pageId , $ record ->getRawRecord ()? ->toArray());
12841283 $ theData [$ fCol ] = $ this ->linkUrlMail (htmlspecialchars ((string )$ tmpProc ), (string )$ fieldValue );
12851284 }
12861285 }
@@ -1785,7 +1784,7 @@ public function makeControl($table, RecordInterface $record)
17851784 $ hiddenTitle = $ this ->getLanguageService ()->sL ('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:unHide ' . ($ table === 'pages ' ? 'Page ' : '' ));
17861785 $ hiddenIcon = 'actions-edit-unhide ' ;
17871786 $ hiddenValue = '1 ' ;
1788- if ($ record ->getRawRecord ()-> get ($ hiddenField ) ?? false ) {
1787+ if (( $ rawRecord = $ record ->getRawRecord ())?->has( $ hiddenField ) && ( $ rawRecord -> get ($ hiddenField ) ?? false ) ) {
17891788 $ titleLabel = $ hiddenTitle ;
17901789 $ iconIdentifier = $ hiddenIcon ;
17911790 $ status = 'hidden ' ;
@@ -2075,7 +2074,7 @@ public function makeClip(string $table, RecordInterface $record, array &$cells):
20752074 $ this ->addDividerToCellGroup ($ cells );
20762075 $ pasteAfterUrl = $ this ->clipObj ->pasteUrl ($ table , -$ record ->getUid ());
20772076 $ pasteAfterTitle = $ this ->getLanguageService ()->sL ('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:clip_pasteAfter ' );
2078- $ pasteAfterContent = $ this ->clipObj ->confirmMsgText ($ table , $ record ->getRawRecord ()->toArray (), 'after ' );
2077+ $ pasteAfterContent = $ this ->clipObj ->confirmMsgText ($ table , $ record ->getRawRecord ()? ->toArray(), 'after ' );
20792078 $ clipboardCells ['pasteAfter ' ] = '
20802079 <button type="button" class="btn btn-default t3js-modal-trigger" data-severity="warning" aria-haspopup="dialog" title=" ' . htmlspecialchars ($ pasteAfterTitle ) . '" aria-label=" ' . htmlspecialchars ($ pasteAfterTitle ) . '" data-uri=" ' . htmlspecialchars ($ pasteAfterUrl ) . '" data-bs-content=" ' . htmlspecialchars ($ pasteAfterContent ) . '">
20812080 ' . $ this ->iconFactory ->getIcon ('actions-document-paste-after ' , IconSize::SMALL )->render () . '
@@ -2089,7 +2088,7 @@ public function makeClip(string $table, RecordInterface $record, array &$cells):
20892088 $ this ->addDividerToCellGroup ($ cells );
20902089 $ pasteIntoUrl = $ this ->clipObj ->pasteUrl ('' , $ record ->getUid ());
20912090 $ pasteIntoTitle = $ this ->getLanguageService ()->sL ('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:clip_pasteInto ' );
2092- $ pasteIntoContent = $ this ->clipObj ->confirmMsgText ($ table , $ record ->getRawRecord ()->toArray (), 'into ' );
2091+ $ pasteIntoContent = $ this ->clipObj ->confirmMsgText ($ table , $ record ->getRawRecord ()? ->toArray(), 'into ' );
20932092 $ clipboardCells ['pasteInto ' ] = '
20942093 <button type="button" class="btn btn-default t3js-modal-trigger" aria-haspopup="dialog" data-severity="warning" title=" ' . htmlspecialchars ($ pasteIntoTitle ) . '" aria-label=" ' . htmlspecialchars ($ pasteIntoTitle ) . '" data-uri=" ' . htmlspecialchars ($ pasteIntoUrl ) . '" data-bs-content=" ' . htmlspecialchars ($ pasteIntoContent ) . '">
20952094 ' . $ this ->iconFactory ->getIcon ('actions-document-paste-into ' , IconSize::SMALL )->render () . '
@@ -3462,13 +3461,13 @@ protected function isLocalized(RecordInterface $record): bool
34623461 return $ record ->getLanguageId () > 0 && $ record ->getLanguageInfo ()?->getTranslationParent() > 0 ;
34633462 }
34643463 $ schema = $ this ->tcaSchemaFactory ->get ($ record ->getMainType ());
3465- if ($ schema ->isLanguageAware ()) {
3464+ if ($ schema ->isLanguageAware () && ( $ rawRecord = $ record -> getRawRecord ()) !== null ) {
34663465 $ languageFieldName = $ schema ->getCapability (TcaSchemaCapability::Language)->getLanguageField ()->getName ();
34673466 $ transPointerFieldName = $ schema ->getCapability (TcaSchemaCapability::Language)->getTranslationOriginPointerField ()->getName ();
3468- try {
3469- return $ record -> getRawRecord ()?->get( $ languageFieldName ) > 0 && $ record -> getRawRecord ()-> get ($ transPointerFieldName ) > 0 ;
3470- } catch ( RecordPropertyNotFoundException ) {
3471- }
3467+ return $ rawRecord -> has ( $ languageFieldName )
3468+ && $ rawRecord -> get ($ languageFieldName ) > 0
3469+ && $ rawRecord -> has ( $ transPointerFieldName )
3470+ && $ rawRecord -> get ( $ transPointerFieldName ) > 0 ;
34723471 }
34733472 return false ;
34743473 }
0 commit comments