sebkln / content_slug

Adds a slug field for human-readable anchors ("domain.com/page/#my-section") to TYPO3 content elements. By default, this anchor is rendered as the header's id attribute.
GNU General Public License v2.0
11 stars 5 forks source link

Exception in ReplaceFragment.php if Content Element of Pagelink is not available anymore in database #14

Closed DavidR93 closed 1 year ago

DavidR93 commented 1 year ago

If the Content Element (anchor) of a page link is not available in database (tt_content) anymore the Query Result is false which leads to an exception in Hook-Class "ReplaceFragment.php". It would be nice if there was a condition that checks if the query was successful.

TYPO3\CMS\Core\Error\Exception PHP Warning: Trying to access array offset on value of type bool in /var/www/html/Source/public/typo3conf/ext/content_slug/Classes/Hooks/ReplaceFragment.php line 73

Enviroment: sebkln/content-slug 3.0.0 TYPO3 11.5.24 PHP 8.1.13

DavidR93 commented 1 year ago

Hello Sebastian, first of all thank you for your great extension.

I have suggested a change to fix this issue. #15

Kind regards David

sebkln commented 1 year ago

Hi David, thank you for both your report and PR. I'll review it and create a new release.

sebkln commented 1 year ago

Merged and released. I also checked the v2.x branch (with compatibility for TYPO3 v10 and v11), this version is not affected.