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

Another importer fix. #5383

Merged
merged 2 commits into from
Apr 18, 2018
Merged

Another importer fix. #5383

merged 2 commits into from
Apr 18, 2018

Conversation

dmeltzer
Copy link
Contributor

Fix condition where matching user fails when providing a username but no full name. Also shortcircuit username matching if a username exists.

Should provide a test for this... but I have to run at the moment. Remind me later :)

… no full name. Also shortcircuit username matching if a user exists.
If the user provided is numeric, but doesn't exist in the database, assume that the user's name is a number and go through all relevant generation.  of email/first+last names.  Alternatively we may want to abort or remove the is_numeric bits.. it seems a little counterintuitive
@dmeltzer
Copy link
Contributor Author

The second commit above makes some changes to how we handle logic around providing a number as the users name. Previously if a number was provided, we assumed it was a user's id from the database, and looked up that id. If a user matching that ID existed, we'd return that user, otherwise we'd jump straight to creating a user with a full name of that id and whatever username /email was provided. This runs that user's full name through the logic that guesses usernames/emails/first+last names based on the full name.

Alternatively we may want to think about removing this "feature". It seems much more straightforward to just support username matching or add a "user id" field. Relying on the user's name as a number to be an id feels like it could have surprising unexpected consequences given how not documented it is.

@fletch8527
Copy link

Applied updated Importer.php. Confirmed that when a username column in the csv file was mapped to the 'Username' field for the import that the asset was correctly checked out to that user. My users were synced from LDAP/AD prior to the asset import and I used the samaccountname from AD as the username for the import. I opened an issue (#5363 ) regarding this and Import History. Appears that I can now import assets and have them assigned. Import History still does not work at this time.

@yokhoe
Copy link

yokhoe commented May 7, 2018

Hello, is this fix implemented in 4.3.0? I too have users who are imported from LDAP/AD and this is the only format the importer is capable of processing. The problem is even if I switch the Header Field 'username' to Import Field 'checked out to', it doesn't show the asset as being checked out. I tried selecting Import Field 'Full Name' and it is stuck on processing.

image

BTW, I think the writing in the Import guide page vs the Importer Issues guide page in regards to this subject can be rewritten around the same language. At this moment, I think the difference brings out some confusion.

@fletch8527
Copy link

@yokhoe you have to map your username header to the username field (not 'checked out to' or 'full name') it worked for me

@yokhoe
Copy link

yokhoe commented May 10, 2018

@fletch8527 not for me, I did that as well previously, keeping the Username header from the CSV and map it to the Username field. It import successfully, but it doesn't list the assets as being checked out to that user.

@dmeltzer dmeltzer deleted the importer-username-fix branch July 17, 2018 00:51
@TrevorCostello
Copy link

Having the same issue, the import history gives success but doesn't actually check out the items to the user. Also tried the Name field instead of username. I'm resorting to manually bulk checkout for hundreds of items per user. Wish this would get resolved. Or at least allow comma separated asset #'s rather than searching for each one and having to select it in the bulk checkout screen.

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

Successfully merging this pull request may close these issues.

5 participants