akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
950 stars 512 forks source link

LoadUser addGroup data fixtures bug, prevents to load custom data #4065

Closed a2xchip closed 8 years ago

a2xchip commented 8 years ago

I'm reporting a Bug The line of code linked above have to be deleted because it prevents to load users own fixtures where threre is no such group. addGroup('All')

nidup commented 8 years ago

Hi @a2xchip The group "All" is mandatory, the PIM can't work properly without this default user group. You can fix your data set by adding this user group https://github.com/akeneo/pim-community-dev/blob/1.4/src/Pim/Bundle/InstallerBundle/Resources/fixtures/minimal/user_groups.yml#L8 Don't hesitate if you need any further information.

a2xchip commented 8 years ago

Where does akeneo use it?

nidup commented 8 years ago

You can find the list by looking at the classes calling this method https://github.com/akeneo/pim-community-dev/blob/master/src/Pim/Bundle/UserBundle/Entity/Repository/GroupRepository.php#L56

a2xchip commented 8 years ago

@nidup I think the problem is that code relies on local specific name All instead of its key. For example my implementation uses russian as default language and i also have user group all but its name is Все and there is no english locale. I made thing you proposed and installation works fine but i can's see group All in group listing.

nidup commented 8 years ago

The group "all" never appears in the user management UI, neither in group list, neither in user edit, it's a system group added for any users created in the PIM. cf http://demo.akeneo.com/#url=/user/group

It's mainly used in Enterprise Edition to grant permissions to any users and appears in "permissions" tabs of "locale", "attribute", "category", etc (in the Enterprise Edition only).

For legacy reasons, the PIM does not provide a field named "code" for any of UserBundle entities which is not consistent with all other entities of the PIM for which we provide a code (we would improve this but it requires some work to provide simple migration path).

a2xchip commented 8 years ago

Thanks for your answer @nidup. Things became clear. I'm curious if it is possible to document it as "note" in Cookbook -> How to Customize Import / Export section? Detailed project documentation sometimes is much important than projects stability and features.

nidup commented 8 years ago

Thank you for the feedback and agree with you that our documentation could mention this, don't hesitate to open a pull request on https://github.com/akeneo/pim-docs to add this information.

a2xchip commented 8 years ago

Coming soon )) @nidup

nidup commented 8 years ago

Great! we'll be glad to help and merge :)