ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Minimum user name length and xml imports

May 24, 2012 4:05pm

Subscribe [2]
  • #1 / May 24, 2012 4:05pm

    fkelly

    5 posts

    In 2.5 it appears that the minimum length of the username field is 4 characters and that this is set early in the installation process and base64_encoded(serialized) into a site_member_preferences field together with other site preferences.  I didn’t notice during the install process whether there was an option to change this (and don’t want to run another install right now just to find out).  I can find nothing on the CP settings for members that gives me an option to change it.

    Starting from scratch I would be happy to require a minimum username length of 4, but I’m not.  I have 1700 usernames to convert and some of them are < 4 characters. 

    So, question 1, is there any way to change this one you have run an install? 

    Second, while the xml member import is a great tool, if your xml file has any errors it just dies.  I created an xml file from my old database (another CMS) and had some empty <member></member> pairs where the length of the old username was < 4.  I can correct this either by padding the usernames or omitting the <member></member> pairs in those cases (which would mean of course those usernames don’t get converted).  However, I’d like to suggest that, at a mimimum, you add some instructions that users should run their xml files through the w3c validator ... that will tell you what line numbers you have errors on and help diagnose the problems.  That’s if you can’t put some diagnostics into your own xml parser.  I’m assuming of course that the xml parser will pick up the preference if the username minimum length is changed on installation.

    Thanks

  • #2 / May 25, 2012 12:54pm

    Dan Decker

    7338 posts

    Hi fkelly,

    Thanks for using the Forums!

    You can set this in Admin-> Security and Privacy-> Security and Sessions: Minimum Username Length.

    Set that to the minimum you need to do your import.

    Have you tried creating your member export as a CSV and letting Member Import Utility create the XML file for Import.

    Let me know if you have any questions!

    Cheers,

  • #3 / May 25, 2012 1:55pm

    fkelly

    5 posts

    Setting minimum username length the way you suggested worked.  Thanks!  I just didn’t know where to look.

    As to creating a csv first, that just seems to be an extra step for me and a little bit indirect.  It’s easy enough to write the program to loop through the records and create the xml file.  Now that I know to validate the file in the W3C validator before trying to import it, it should be easy to diagnose any problems.  I just thought you might want to either build some basic diagnostics in or else just suggest that people run their xml file through a validator.  Heck:  you could even code the “unable to parse XML file” error message to say “unable to parse XML file:  please run it through an external validator to diagnose problems”.  Or something to that effect.

  • #4 / May 31, 2012 12:45pm

    Shane Eckert

    7174 posts

    Hey fkelly,

    I am glad that Dan was able to help you out! That rocks!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases