Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XmlDriver Exception migrating to PHP 8.2 #3065

Closed
yard-mschwartz opened this issue Dec 11, 2023 · 2 comments
Closed

XmlDriver Exception migrating to PHP 8.2 #3065

yard-mschwartz opened this issue Dec 11, 2023 · 2 comments

Comments

@yard-mschwartz
Copy link

Symfony FOSUserBundle versions: dev-master (v3.2.1 at the time of writing)

Description of the problem including expected versus actual behavior:

Application runs just fine on PHP 7.4, but of course we need to migrate to PHP 8.x rather sooner than later. After setting the PHP-version to ^8.2 and running composer update, Symfony automatically runs symfony console cache:clear for us. Then the following error appears:

$ symfony console cache:clear

 [WARNING] Some commands could not be registered:                                                                       

In XmlDriver.php line 1006:

  Warning: DOMDocument::schemaValidate(): Invalid Schema

When I go to that line, it shows:

try {
    $document = new DOMDocument();
    $document->load($file);

    if (! $document->schemaValidate(__DIR__ . '/../../../../../doctrine-mapping.xsd')) {
        throw MappingException::fromLibXmlErrors(libxml_get_errors());
    }

    ...
}

When I dump the value of $file, it shows [...]/vendor/friendsofsymfony/user-bundle/Resources/config/doctrine-mapping/User.orm.xml, as if that file is not a valid mapping file. Symfony didn't complain about this while I was still on version PHP 7.4.

Obviously the recommended approach is to move away from this library, but maybe someone knows a quick fix for this. Quite possible that this error is more related to Doctrine than to this bundle, but decided to ask here first.

@yard-mschwartz
Copy link
Author

yard-mschwartz commented Dec 13, 2023

As of now, it appears to be a problem that comes up with libxml 2.12 introduced by modern PHP-versions: doctrine/orm#11117

@stof
Copy link
Member

stof commented Jan 16, 2024

Closing this in favor of the doctrine/orm issue as this is not a bug in FOSUserBundle but an issue in the Doctrine ORM XSD schema itself.

@stof stof closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants