Skip to content

Magento 2.4.2 to 2.4.3 Upgrade Issue use php 8 function #33755

Closed
@magedevel

Description

@magedevel

Preconditions (*)

  1. Try to upgrade from version 2.4.2-p1 to 2.4.3
  2. MSI modules are disabled using a replace on composer.

Steps to reproduce (*)

  1. execute: composer require magento/product-community-edition=2.4.3 --no-update
  2. execute : composer update

Expected result (*)

  1. Magento was updated to version 2.4.3

Actual result (*)

  1. Has got an error :
    Fatal error: Uncaught Error: Call to undefined function Magento\Framework\Filesystem\Directory\str_contains() in /var/www/html/vendor/magento/framework/Filesystem/Directory/DenyListPathValidator.php:74
    Class \Magento\Framework\Filesystem\Directory\DenyListPathValidator use a PHP 8.0 function. (str_contains)
....
foreach ($this->fileDenyList as $file) {
            $baseName = pathinfo($actualPath, PATHINFO_BASENAME);
            if (str_contains($baseName, $file) || preg_match('#' . "\." . $file . '#', $fullPath)) {
                throw new ValidatorException(
                    new Phrase('"%1" is not a valid file path', [$path])
                );
            }
        }

Notes

Based on requirement this version should work on PHP 7.4
https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html

And in the release note (https://devdocs.magento.com/guides/v2.4/release-notes/open-source-2-4-3.html) you wrote:
Magento 2.4.3 is not yet compatible with PHP 8.x, but the following platform upgrades bring us closer to future compatibility with PHP 8.x.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions