fnagel / generic-gallery

TYPO3 extension: Generic Gallery - One gallery to rule them all!
https://extensions.typo3.org/extension/generic_gallery/
GNU General Public License v3.0
7 stars 12 forks source link

BE parse error in PHP 7.4 with version 5.0.0 #39

Closed dfpsoeew closed 2 years ago

dfpsoeew commented 2 years ago

Not sure if this error is my fault but I'm getting a parse error in backend after updating to 5.0.0 (running PHP 7.4 by the way):

(1/1) ParseError

syntax error, unexpected '|', expecting ';' or '{' in ...\typo3conf\ext\generic_gallery\Classes\Domain\Model\GalleryItem.php line 88

    {
        $this->textItems = new ObjectStorage();
    }

    public function getIdentifier(): int|string
    {
        $identifier = $this->getUid();

        if ($identifier === null) {
fnagel commented 2 years ago

No, I'm pretty sure this is an issue with the changes I've did for #38, likely the type hit changes. I guess I've did something wrong regarding PHP 7.4 / PHP 8.0 compatibility.

I'm on it!

fnagel commented 2 years ago

I've fixed some union type issues (which are not available in PHP 7.4) and added very basic tests to prevent something like this to happen again.

Broken: https://github.com/fnagel/generic-gallery/runs/4512959352?check_suite_focus=true Fixed: https://github.com/fnagel/generic-gallery/runs/4513128231?check_suite_focus=true

Would you please test branch https://github.com/fnagel/generic-gallery/tree/php-74-fixes and give feedback. I will release a bugfix version shortly after!

dfpsoeew commented 2 years ago

This branch is working for me. Thank you for the quick fix!

fnagel commented 2 years ago

Wonderful. Thanks for the quick feedback. New release is on its way!

fnagel commented 2 years ago

https://github.com/fnagel/generic-gallery/releases/tag/5.0.1