kaliop-uk / ezmigrationbundle

This bundle makes it easy to handle eZPlatform / eZPublish5 content upgrades/migrations
GNU General Public License v2.0
53 stars 81 forks source link

User Create extra attributes #191

Closed raupie closed 5 years ago

raupie commented 5 years ago

I added an extra attribute to the user content_type for storing a users 'job title'.

However, when creating a new user using the type: user it is unable to match the job_title attribute so it ends up null.

I suppose the other way to do this is to create the user via the

type: content
mode: create
content_type: user
...
raupie commented 5 years ago

Looks like I can do something like this as a work around.

-
  type: user
  mode: create
  first_name: Stephen
  last_name: King
  username: stephen.king
  email: stephen.king@author.com
  password: password123
  lang: eng-GB
  groups: [authors_group]
  references:
    -
      identifier: ref.user.stephen_king
      attribute: user_id

-
  type: content
  mode: update
  lang: eng-GB
  match:
    content_id: "reference:ref.user.stephen_king"
  new_remote_id: user.stephen_king
  attributes:
    job_title: 'Famous Author'
gggeek commented 5 years ago

Indeed, at the moment the user/create and user/update migration steps are quite limited. It is possible to achieve full editing of users by doing a two-step manipulation, as you have found out. I will create a new feature-request to allow the user migration steps to become full featured, but it will most likely stay as low priority for a while. In the meantime, I will add a note to the docs