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

invalid xml mapping file (mongodb) #483

Merged
merged 5 commits into from
Jan 7, 2020
Merged

invalid xml mapping file (mongodb) #483

merged 5 commits into from
Jan 7, 2020

Conversation

romainnorberg
Copy link
Contributor

@romainnorberg romainnorberg commented Nov 18, 2019

Subject

In a Symfony 4.3.8 project, when we update the doctrine/mongodb-odm and doctrine/mongodb-odm-bundle packages in their latest version, the following error appears:

The mapping file /var/www/project/vendor/sonata-project/classification-bundle/src/Resources/config/doctrine/BaseTag.mongodb.xml is invalid: Line 2:0: Element '{http://doctrine-project.org/schemas/orm/doctrine-mongo-mapping}doctrine-mongo-mapping': No matching global declaration available for the validation root.

        "doctrine/mongodb-odm": "^2.0",
        "doctrine/mongodb-odm-bundle": "^4.0",

http://doctrine-project.org/schemas/orm/doctrine-mongo-mapping.xsd (404) is not valid, new url seems http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd

I don't know which branch to target, I think it's master in this case. Need Help

Related issue:

Related documentation:

Changelog

### Fixed
- Fix invalid Mongodb mapping files (mongodb-odm >= 2.0)

Screenshots

Screenshot 2019-11-18 at 15 56 50

To Reproduce / configuration:

composer.json

"require": {
        "php": ">=7.3",
        "ext-ftp": "*",
        "ext-igbinary": "*",
        "ext-json": "*",
        "ext-mongodb": "*",
        "ext-pcntl": "*",
        "ext-posix": "*",
        "ext-redis": "*",
        "ext-soap": "*",
        "adoy/oauth2": "dev-master",
        "alcaeus/mongo-php-adapter": "^1.1",
        "azuyalabs/yasumi": "^2.0",
        "beberlei/doctrineextensions": "^1.1",
        "cocur/slugify": "^3.2",
        "datadog/php-datadogstatsd": "^1.3",
        "doctrine/dbal": "^2.9",
        "doctrine/doctrine-bundle": "^1.11",
        "doctrine/doctrine-cache-bundle": "^1.3",
        "doctrine/doctrine-migrations-bundle": "^2.0",
        "doctrine/mongodb-odm": "^2.0",
        "doctrine/mongodb-odm-bundle": "^4.0",
        "doctrine/orm": "^2.5",
        "donatj/phpuseragentparser": "^0.13.0",
        "egulias/email-validator": "^2.1",
        "elasticsearch/elasticsearch": "^6.1",
        "fightbulc/moment": "^1.25",
        "florianv/exchanger": "1.4.1",
        "florianv/swap": "^3.4",
        "friendsofsymfony/elastica-bundle": "^5.1",
        "friendsofsymfony/jsrouting-bundle": "^2.3",
        "friendsofsymfony/rest-bundle": "^2.5",
        "gedmo/doctrine-extensions": "~2.4",
        "geoip2/geoip2": "~2.0",
        "google/apiclient": "^2.0",
        "googleads/googleads-php-lib": "^43.0",
        "guzzlehttp/guzzle": "^6.3",
        "hashids/hashids": "^4.0",
        "hutnikau/job-scheduler": "^0.6",
        "knplabs/knp-menu": "~2.0",
        "knplabs/knp-paginator-bundle": "^3.0",
        "league/oauth1-client": "^1.7",
        "league/uri": "^5.3",
        "microsoft/bingads": "^v0.12.13",
        "mobiledetect/mobiledetectlib": "^2.8",
        "monolog/monolog": "^2.0.0 || ^1.17.1",
        "nesbot/carbon": "^2.11",
        "ocramius/doctrine-batch-utils": "^2.0",
        "php-http/guzzle6-adapter": "^2.0",
        "php-http/httplug-bundle": "^1.15",
        "php-http/message": "^1.6",
        "phpoffice/phpspreadsheet": "^1.6",
        "phpseclib/phpseclib": "^2.0",
        "portphp/csv": "^1.1",
        "portphp/excel": "^1.1",
        "portphp/portphp": "^1.3",
        "predis/predis": "^1.1",
        "ramsey/uuid": "^3.8",
        "rollerworks/password-strength-validator": "^1.1",
        "scienta/doctrine-json-functions": "^4.0",
        "sensio/framework-extra-bundle": "^5.3",
        "snc/redis-bundle": "^3.1",
        "sonata-project/admin-bundle": "^3.0",
        "sonata-project/classification-bundle": "^3.8",
        "sonata-project/doctrine-mongodb-admin-bundle": "^3.2",
        "sonata-project/doctrine-orm-admin-bundle": "^3.8",
        "sonata-project/exporter": "^2.0.1",
        "sonata-project/formatter-bundle": "^4.1",
        "sonata-project/intl-bundle": "^2.5",
        "sonata-project/media-bundle": "^3.0",
        "sonata-project/translation-bundle": "^2.0",
        "spatie/data-transfer-object": "^1.6",
        "stof/doctrine-extensions-bundle": "~1.1",
        "symfony/asset": "^4.2",
        "symfony/dotenv": "^4.2",
        "symfony/flex": "^1.2",
        "symfony/form": "^4.2",
        "symfony/lock": "^4.2",
        "symfony/monolog-bundle": "^3.4",
        "symfony/process": "^4.2",
        "symfony/security-bundle": "^4.2",
        "symfony/serializer": "^4.3",
        "symfony/swiftmailer-bundle": "^3.2",
        "symfony/translation": "^4.2",
        "symfony/twig-bundle": "^4.2",
        "symfony/validator": "^4.2",
        "symfony/webpack-encore-bundle": "^1.4",
        "twig/extensions": "^1.5",
        "twig/twig": "^2.6",
        "willdurand/jsonp-callback-validator": "^1.1"
    },
    "require-dev": {
        "ext-libxml": "*",
        "ext-simplexml": "*",
        "doctrine/data-fixtures": "^1.3",
        "doctrine/doctrine-fixtures-bundle": "^3.1",
        "friendsofphp/php-cs-fixer": "^2.15",
        "fzaninotto/faker": "^1.7",
        "hoa/regex": "^1.17",
        "mockery/mockery": "^1.2",
        "nelmio/alice": "^3.5",
        "phpstan/phpstan": "^0.11",
        "phpstan/phpstan-doctrine": "^0.11",
        "phpunit/phpunit": "^8.3",
        "roave/security-advisories": "dev-master",
        "rg/phpnsc": "^5.0",
        "spatie/phpunit-snapshot-assertions": "^2.1",
        "spatie/phpunit-watcher": "^1.6",
        "symfony/browser-kit": "^4.2",
        "symfony/css-selector": "^4.2",
        "symfony/debug-bundle": "^4.2",
        "symfony/maker-bundle": "^1.11",
        "symfony/orm-pack": "^1.0",
        "symfony/phpunit-bridge": "^4.2",
        "symfony/var-dumper": "^4.2",
        "symfony/web-profiler-bundle": "^4.2",
        "theofidry/alice-data-fixtures": "^1.1"
    },

@OskarStark
Copy link
Member

Thanks for the fix, I think you should target 3.x branch, do the fix and increase the versions in the composer.json

Copy link
Member

@core23 core23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add the mentioned mongo lib to the composer.json file

@romainnorberg romainnorberg changed the base branch from master to 3.x November 19, 2019 07:27
composer.json Outdated
@@ -23,6 +23,7 @@
"require": {
"php": "^7.1",
"cocur/slugify": "^2.0 || ^3.0",
"doctrine/mongodb-odm": "^2.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an optional dependency. So please add it to require-dev and add a conflict entry for unsupported versions

@core23
Copy link
Member

core23 commented Nov 19, 2019

cc @sonata-project/contributors we need a dev-kit update for this :/

@romainnorberg
Copy link
Contributor Author

Sorry, I thought I could easily help on this point but it becomes more complex.

I do not know how to proceed, do we install the mongodb extension as here: https://github.com/doctrine/mongodb-odm/blob/master/.travis.yml#L86 ?

@core23
Copy link
Member

core23 commented Nov 28, 2019

Can you please rebase @romainnorberg This got fixed with the last dev-kit update

@romainnorberg
Copy link
Contributor Author

hello @core23 Thanks.

I rebased, but there are still issue on PHP7.1:

doctrine/mongodb-odm 2.0.3 requires php ^7.2

@core23
Copy link
Member

core23 commented Nov 28, 2019

@sonata-project/contributors I think we can drop PHP 7.1, support ends in 2 days 😆

https://www.php.net/supported-versions.php

@phansys phansys added the patch label Nov 28, 2019
phansys
phansys previously approved these changes Nov 28, 2019
@core23
Copy link
Member

core23 commented Nov 28, 2019

@sonata-project/contributors I think we can drop PHP 7.1, support ends in 2 days laughing

https://www.php.net/supported-versions.php

Refs: sonata-project/dev-kit#524

After deploying this, PHP 7.1 is gone

@SonataCI
Copy link
Collaborator

SonataCI commented Jan 6, 2020

Could you please rebase your PR and fix merge conflicts?

@greg0ire greg0ire merged commit cc276ec into sonata-project:master Jan 7, 2020
@greg0ire
Copy link
Contributor

greg0ire commented Jan 7, 2020

Thanks @romainnorberg !

@romainnorberg romainnorberg deleted the fix-doctrine-mongo-mapping branch January 7, 2020 08:10
@romainnorberg
Copy link
Contributor Author

Thanks to you @greg0ire and Sonata Team for your patience and awesome work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants