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

BaseGroup.mongodb.xml is invalid #1120

Closed
helacer3 opened this issue Oct 22, 2019 · 9 comments
Closed

BaseGroup.mongodb.xml is invalid #1120

helacer3 opened this issue Oct 22, 2019 · 9 comments

Comments

@helacer3
Copy link

I have a symfony 4.3.5 application with sonata admin. A few days ago I had to perform the dependency update and this error is appearing in the package. I try, installing different versions but they all found me this error, which I didn't find documentation for their solution

Resources/config/doctrine/BaseGroup.mongodb.xml is invalid: Line 2:0: Element '{http://doctrine-project.org/schemas/orm/doctrine-mapping}doctrine-mapping': No matching global declaration available for the validation root.

COMPOSER.JSON

    "sonata-project/core-bundle": "^3.12.0",
    "sonata-project/user-bundle": "^4.2.0",

Can you help me verify what is happening? Thank you!

@stale
Copy link

stale bot commented Jan 30, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

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

@stale stale bot added the wontfix label Jan 30, 2020
@SonataCI SonataCI removed the wontfix label Jan 30, 2020
@javer
Copy link
Contributor

javer commented Feb 4, 2020

Yes, bug is still relevant, to fix it the following changes

s/doctrine-mapping/doctrine-mongo-mapping/
s/orm/odm/

should be applied to the following files:

  • src/Resources/config/doctrine/BaseGroup.mongodb.xml
  • src/Resources/config/doctrine/BaseUser.mongodb.xml

But it will break backward compatibility with doctrine/mongodb-odm 1.x, so major version should be bumped.

@core23
Copy link
Member

core23 commented Feb 4, 2020

But it will break backward compatibility with doctrine/mongodb-odm 1.x, so major version should be bumped.

This is not a BC break as long us you update the composer definition for this lib. Can you provide a PR @javer

@javer
Copy link
Contributor

javer commented Feb 4, 2020

@core23 It seems that this issue is already fixed in #1140, but it's not released yet. Could you please make a new release with all recent fixes?

@core23
Copy link
Member

core23 commented Feb 4, 2020

@sonata-project/release-managers Can you please tag a new release

@jordisala1991
Copy link
Member

Closing as this was released already in 4.5.2

@webdevilopers
Copy link

I still have the issue with the following packages:

    "require": {
        "php": "^7.4",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "ext-intl": "*",
        "friendsofsymfony/user-bundle": "^2.1",
        "sonata-project/admin-bundle": "^3.93",
        "sonata-project/doctrine-mongodb-admin-bundle": "^3.7",
        "sonata-project/exporter": "2.x",
        "sonata-project/intl-bundle": "^2.10",
        "sonata-project/translation-bundle": "^2.7",
        "sonata-project/user-bundle": "^4.11",
        "symfony/apache-pack": "^1.0",
        "symfony/dotenv": "^4.4",
        "symfony/flex": "^1.12",
        "symfony/framework-bundle": "^4.4",
        "symfony/http-kernel": "^4.4",
        "symfony/yaml": "^4.4",
        "twig/twig": "^2.9"
    },

Refs:

@webdevilopers
Copy link

Let me correct this. The mapping for this bundle has indeed been fixed:

<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping                         http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
    <mapped-superclass name="Sonata\UserBundle\Document\BaseUser">
        <field name="createdAt" type="date"/>
        <field name="updatedAt" type="date"/>
        <!-- Profile fields -->
        <field name="dateOfBirth" type="date"/>
        <field name="firstname" type="string"/>
        <field name="lastname" type="string"/>
        <field name="website" type="string"/>
        <field name="biography" type="string"/>
        <field name="gender" type="string"/>
        <field name="locale" type="string"/>
        <field name="timezone" type="string"/>
        <field name="phone" type="string"/>
        <!-- social fields -->
        <field name="facebookUid" type="string"/>
        <field name="facebookName" type="string"/>
        <field name="facebookData" type="hash"/>
        <field name="twitterUid" type="string"/>
        <field name="twitterName" type="string"/>
        <field name="twitterData" type="hash"/>
        <field name="gplusUid" type="string"/>
        <field name="gplusName" type="string"/>
        <field name="gplusData" type="hash"/>
        <!-- extra security fields -->
        <field name="token" type="string"/>
        <field name="twoStepVerificationCode" type="string"/>
        <lifecycle-callbacks>
            <lifecycle-callback type="prePersist" method="prePersist"/>
            <lifecycle-callback type="preUpdate" method="preUpdate"/>
        </lifecycle-callbacks>
    </mapped-superclass>
</doctrine-mongo-mapping>

But with the packages mentioned above I the the error for the FosUserBundle itself:

  The mapping file //vendor/friendsofsymfony/user-bundl  
  e/Resources/config/doctrine-mapping/Group.mongodb.xml is invalid:            
  Line 9:0: Element '{http://doctrine-project.org/schemas/odm/doctrine-mongo-  
  mapping}field', attribute 'fieldName': The attribute 'fieldName' is not all  
  owed.                                                                        
                                                                               
  Line 11:0: Element '{http://doctrine-project.org/schemas/odm/doctrine-mongo  
  -mapping}field', attribute 'fieldName': The attribute 'fieldName' is not al  
  lowed.                                                                       
                 

@webdevilopers
Copy link

I linked the following issue there: FriendsOfSymfony/FOSUserBundle#2948
Maybe this is just a matter of package versions?

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

No branches or pull requests

6 participants