FriendsOfTYPO3 / tt_address

Add address / contact datasets to your content management system.
GNU General Public License v2.0
38 stars 76 forks source link

Deleting Record results in Error #513

Closed calien666 closed 4 months ago

calien666 commented 7 months ago

Bug Report

Current Behavior When deleting a record, the Hooks\Tca\Label::getAddressLabel is called and tries to detect the record from the param. This errors in

PHP Warning: Trying to access array offset on value of type null in /var/www/html/.Build/public/typo3conf/ext/tt_address/Classes/Hooks/Tca/Label.php line 34

with latest 8.0.2. In main branch, the error occurs on line 38.

The Bugfix #512 solving #511 doesn't solve this problem, as a deleted record has a valid numeric uid, but doesn't get fetched by BackendUtility::getRecord() as this method normally excludes deleted records.

The issue occurs in PHP >= 8.1 (possibly 8.0, too?), tested in 7.4 without problems.

Expected behavior/output I'm not sure, if the method should execute on deleted records, too, thus I don't have an expected behaviour.

Environment

Possible Solution

Additional context Deleting a record in backend only lets the delete icon spin. Reloading shows, the record was deleted. This bug was discovered while working on sudhaus7/xlsimport and testing for TYPO3 11 functionality after preparing v12 support.

georgringer commented 7 months ago

thanks - wanna do a PR?

calien666 commented 7 months ago

Hi @georgringer Sorry for responding that late. I would do a PR, but as I wrote above, there are two possible solutions. I don't know, which one you prefer.

georgringer commented 6 months ago

TBH I don'T have a real opinion but I guess the 2nd one to be in line with

Patta commented 6 months ago

I can confirm this issue with latest release 8.0.3 Core: Error handler (BE): PHP Warning: Trying to access array offset on value of type null in /var/www/html/vendor/friendsoftypo3/tt-address/Classes/Hooks/Tca/Label.php line 38

calien666 commented 6 months ago

Thanks, @georgringer. I will take a look.

msollmann commented 5 months ago

Can confirm this too. TYPO3 12.4.11, PHP 8.2.13, tt_address 8.0.3

georgringer commented 4 months ago

fixed now