• Resolved dennishall

    (@dennishall)


    Hi:

    This plugin is a great plugin for my needs, however, I’m unable to get the users role to be set.

    In my latest attempts, I’ve edited the CSV file in notepad.exe as to ermove any possible character issues.
    Here are my columns headers:
    username,email,first_name,last_name,password,role,company_name
    Here is my test data associated:
    astudent,[email protected],Test,Student,password,student,Some Company

    In your plugin, the default checked role is “Subscriber”, however, I’m trying to assign the uploaded users to an existing role named “student”.

    No matter what I attempt to do, the users “role” is staying as Administrator after import.

    Any advice?

    Best Regards,

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Javier Carazo

    (@carazo)

    @dennishall,

    Good afternoon, as this is explained in the documentation:

    • You have to create a column called role
    • The column must have the roles using their slug

    Please do not use notepad for CSV management, use some good CSV program like LibreOffice (much better for this than MS Office if you are using Windows or Mac in Linux we cannot use MS Office).

    Thread Starter dennishall

    (@dennishall)

    Thanks for the quick response.

    notepad.exe provides RAW text and never fails, so that is why I have used it.
    Using notepad.exe in ANSI mode is the same as using a CLI or “DOS” editor and there is no character remapping.

    If you please review my original post in this thread, you will see exactly what I had used for CSV headers, the user values and the role slug.
    I’m using comma separated values as well.

    I’ve been working with CSV files and uploads for decades and completely trust what I am doing.

    Best Regards,

    Plugin Author Javier Carazo

    (@carazo)

    @dennishall,

    All seems to be ok… so try with a different role (subscriber for example).

    Anyway if you want to see directly the file, use better a modern editor like Sublime or Atom if you prefer to use a free license software.

    Thread Starter dennishall

    (@dennishall)

    Edited and saved in Sublime Text 3. Exact same results.
    Set user to subscriber, exact same results.

    The user is always being set to administrator.

    I have resolved it by changing the sites Default user role to anything except Administrator and now it is properly uploading with the role I indicate in the CSV file.

    I’m on WP4.9.5 with all plugins (there are not many) and the Astra Pro theme updated.

    I’ve resolved this issue, but it’s good for others to reference.

    Best Regards,

    Plugin Author Javier Carazo

    (@carazo)

    @dennishall,

    Thanks I have to review it, this is really strange.

    We really appreciate you find how to solve the bug.

    Thread Starter dennishall

    (@dennishall)

    Happy to help.

    You’ve created a very handy plugin that I can confirm, does work with MS Office Excel based CSV files.

    Awesome job Javier!
    Thanks for contributing to WordPress.

    Plugin Author Javier Carazo

    (@carazo)

    This is really strange, in this piece of the code we manage it:

    if( $role_position === false )
    						$role = $role_default;
    					else{
    						$roles_cells = explode( ',', $data[ $role_position ] );
    						array_walk( $roles_cells, 'trim' );
    						$role = $roles_cells;
    					}

    But administrator has not a difference behaviour than the others.

    Plugin Author Javier Carazo

    (@carazo)

    Yes we know it works with MS Office but we are from Linux and we always like to promote free solutions like LibreOffice ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘role is not being set’ is closed to new replies.