doctrine-extensions / DoctrineExtensions

Doctrine2 behavioral extensions, Translatable, Sluggable, Tree-NestedSet, Timestampable, Loggable, Sortable
MIT License
4.03k stars 1.26k forks source link

XML Validation Error with Doctrine 2.14.2 #2613

Open rufinus opened 1 year ago

rufinus commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

stof commented 1 year ago

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

ro0NL commented 1 year ago

true :angel: 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

github-actions[bot] commented 6 months ago

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.

mbabker commented 6 months ago

Don't stale this issue...

alebedev80 commented 2 months ago

when it will be fixed?

eisberg commented 2 months ago

Many projects use XML for ORM, and there are no plans to translate this into attributes. In the PR (https://github.com/doctrine-extensions/DoctrineExtensions/pull/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