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

XML Validation Error with Doctrine 2.14.2 #2613

Open
rufinus opened this issue Apr 13, 2023 · 8 comments · May be fixed by #2657, stof/StofDoctrineExtensionsBundle#458 or #2845
Open

XML Validation Error with Doctrine 2.14.2 #2613

rufinus opened this issue Apr 13, 2023 · 8 comments · May be fixed by #2657, stof/StofDoctrineExtensionsBundle#458 or #2845

Comments

@rufinus
Copy link

rufinus commented Apr 13, 2023

Environment

Package

Timestampable

$ composer show --latest gedmo/doctrine-extensions
name     : gedmo/doctrine-extensions
descrip. : Doctrine behavioral extensions
keywords : Blameable, behaviors, doctrine, extensions, gedmo, loggable, nestedset, odm, orm, sluggable, sortable, timestampable, translatable, tree, uploadable
versions : * v3.11.1
latest   : v3.11.1

Doctrine packages

$ composer show --latest 'doctrine/*'

Direct dependencies required in composer.json:
doctrine/annotations                1.14.3 2.0.1  Docblock Annotations Parser
doctrine/doctrine-bundle            2.9.0  2.9.1  Symfony DoctrineBundle
doctrine/doctrine-migrations-bundle 3.2.2  3.2.2  Symfony DoctrineMigrationsBundle
doctrine/migrations                 3.6.0  3.6.0  PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deplo...
doctrine/orm                        2.14.2 2.14.2 Object-Relational-Mapper for PHP

Transitive dependencies not required in composer.json:
doctrine/cache                      2.2.0  2.2.0  PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.
doctrine/collections                2.1.2  2.1.2  PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
doctrine/common                     3.4.3  3.4.3  PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, proxies a...
doctrine/dbal                       3.6.1  3.6.2  Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
doctrine/deprecations               v1.0.0 v1.0.0 A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.
doctrine/event-manager              2.0.0  2.0.0  The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.
doctrine/inflector                  2.0.6  2.0.6  PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.
doctrine/instantiator               1.5.0  2.0.0  A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                      2.1.0  3.0.0  PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
doctrine/persistence                3.1.4  3.1.4  The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.
doctrine/sql-formatter              1.1.3  1.1.3  a PHP SQL highlighting library

PHP version

$ php -v
8.1.16

Subject

Using XML Schema with a timestampable field:

    <field name="createdAt" type="datetime" nullable="true">
      <gedmo:timestampable on="create"/>
    </field>

the following validation error is displayed (eg. on cache:clear):
ibxml error: Element '{http://gediminasm.org/schemas/orm/doctrine-extensions-mapping}timestampable': No matching global element declaration available, but demanded by the strict wildcard. in [file] at line 16

doctrine/orm 2.14.1 is working fine.

@phansys
Copy link
Collaborator

phansys commented Apr 14, 2023

BTW, If you can, please update the issue description with the real output from composer show --latest 'doctrine/*' in order to help other users better understand this problem.

@ro0NL
Copy link

ro0NL commented Aug 14, 2023

fix is doctrine.orm.validate_xml_mapping: false, which is deprecated, which is an issue ... but it works 🤷

@stof
Copy link
Contributor

stof commented Aug 23, 2023

This is not a fix. It is a time-limited workaround

@ro0NL
Copy link

ro0NL commented Aug 23, 2023

true 👼 im not sure what best way forward is. I do like to point out creating addiotional .gedmo.xml (#2657) is not really ideal

in our case, we will probably migrate to attributes sooner or later

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Feb 19, 2024
@mbabker
Copy link
Contributor

mbabker commented Feb 26, 2024

Don't stale this issue...

@github-actions github-actions bot removed the Stale label Feb 27, 2024
@alebedev80
Copy link

when it will be fixed?

@eisberg
Copy link

eisberg commented Jun 25, 2024

Many projects use XML for ORM, and there are no plans to translate this into attributes. In the PR (#2657) I proposed, there are two options for setting up Gedmo:

  1. Use separate XML files for Gedmo ( MyEntity.gedmo.xml )
  2. Use attributes, even if the project uses XML (or annotations) for the ORM.

Without these options, GEDMO takes Doctrine settings, and as a result, it is impossible to use attributes for GEDMO if Doctrine uses xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment