1. athenacraftsltdltd
  2. RO CSVI
  3. Friday, 02 February 2018
  4.  Subscribe via email
Hi all!

This is more a request for usage assistance - the Joomla Users import tutorial appears to be missing: https://csvimproved.com/support/tutorials/251-joomla-users

I want to be able to import a list of users. If the user doesn't exist, I want to be able to add that user to Joomla. For the purpose of security, I've been creating a random, unguessable password and requiring new users to reset their passwords (because it authenticates through their email address, this is more secure than emailing them their new password).

If the user does exist, I *do not* want to change that user's password or require a password reset or inconvenience them at all.

Is this possible? If so, how do I go about it?

Cheers,
Ian
Accepted Answer Pending Moderation
Hello Ian,

the Joomla Users import tutorial appears to be missing
The layout of the category was wrong. I have corrected this and now all shows as expected in the Joomla users tutorials.

Is this a bug? Am I doing something wrong?
This is indeed a bug. The loading of a user would always return true so we figured the user already existed. I have this corrected in the attached patch file. Can you load the patch file and see if this now works for you as expected?
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hello,
is it your belief that all that is required for this to work is to upgrade to 7.4.1 and to apply the patch file?

Yes, update to latest CSVI 7.4.1 version and then apply the patch file Roland had sent you. Check if import works after that.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
I don't see that version information and debug files are of any use here, but if there are differences between versions, I'm using CSVI 7.1.0 at the moment on Joomla 3.7.3
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
I think I might have found it - I want to not 'overwrite existing data' but I couldn't find that option. Got it now.
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Ok, I still have a problem.

I've got a csv file with 3 users in. My database contains 2 of those users, so it should leave those two alone and add the extra user but it isn't.

I've turned on logging to see what's going on and I can see this (for the new user - email address has been changed for data protection reasons):


2018-02-02 16:51:01 2 [QUERY] SELECT id FROM `jos3a_users` WHERE `email` = 'example@example.com'
2018-02-02 16:51:01 2 [DEBUG] Load a row
2018-02-02 16:51:01 2 [DEBUG] Item example@example.com exists, not updating because overwrite existing data is disabled


If I run that SQL query (SELECT id FROM `jos3a_users` WHERE `email` = 'example@example.com') directly in PHPMyAdmin, it returns no rows - the data isn't in the database. Is this a bug? Am I doing something wrong?

The two users that are already in the database are returning similar rows in the log too, but that's to be expected.
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hi Roland,
Thanks for the quick reply and the patch. I think it's still not working though:

Date Time Line Action Comment
Processed 102 lines
2018-02-05 10:19:01 0 [DEBUG] Clean up old logs. Found 26 logs and threshold is 25 logs
2018-02-05 10:19:01 0 [DEBUG] Found field delimiter: ,
2018-02-05 10:19:01 0 [DEBUG] Loading the supported fields for com_users, operation user and action import
2018-02-05 10:19:01 0 [QUERY] SELECT `a`.`csvi_name` FROM `jos3a_csvi_availablefields` AS `a` LEFT JOIN `jos3a_csvi_availabletables` AS `t` ON `t`.`template_table` = `a`.`component_table` WHERE `a`.`component` = 'com_users' AND `t`.`component` = 'com_users' AND `t`.`task_name` = 'user' AND `a`.`action` = 'import' AND `t`.`action` = 'import'
2018-02-05 10:19:01 0 [DEBUG] Load the fields to process
2018-02-05 10:19:01 0 [DEBUG] Field name: skip
2018-02-05 10:19:01 0 [DEBUG] Field name: skip
2018-02-05 10:19:01 0 [DEBUG] Field name: email
2018-02-05 10:19:01 0 [DEBUG] Field name: usergroup_name
2018-02-05 10:19:01 0 [DEBUG] Field name: skip
2018-02-05 10:19:01 0 [DEBUG] Field name: requireReset
2018-02-05 10:19:01 0 [DEBUG] Field name: skip
2018-02-05 10:19:01 0 [DEBUG] Field name: skip
2018-02-05 10:19:01 0 [DEBUG] ==========
2018-02-05 10:19:01 0 [DEBUG] CSVI Pro Version: 7.1.0
2018-02-05 10:19:01 0 [DEBUG] PHP version: 5.3.29
2018-02-05 10:19:01 0 [DEBUG] Action: import
2018-02-05 10:19:01 0 [DEBUG] Component: com_users
2018-02-05 10:19:01 0 [DEBUG] Operation: user
2018-02-05 10:19:01 0 [DEBUG] Override:
2018-02-05 10:19:01 0 [DEBUG] Source: fromupload
2018-02-05 10:19:01 0 [DEBUG] Load from your computer: /home/azeeda/public_html/tmp/com_csvi/2563154680/users.csv
2018-02-05 10:19:01 0 [DEBUG] Load from server:
2018-02-05 10:19:01 0 [DEBUG] Delete after import: No
2018-02-05 10:19:01 0 [DEBUG] Load from URL: http://
2018-02-05 10:19:01 0 [DEBUG] URL Username:
2018-02-05 10:19:01 0 [DEBUG] Name of username field: user
2018-02-05 10:19:01 0 [DEBUG] URL Password:
2018-02-05 10:19:01 0 [DEBUG] Name of the password field: password
2018-02-05 10:19:01 0 [DEBUG] Retrieve method: get
2018-02-05 10:19:01 0 [DEBUG] FTP Host:
2018-02-05 10:19:01 0 [DEBUG] FTP Port:
2018-02-05 10:19:01 0 [DEBUG] FTP Root Folder:
2018-02-05 10:19:01 0 [DEBUG] FTP Filename:
2018-02-05 10:19:01 0 [DEBUG] Username:
2018-02-05 10:19:01 0 [DEBUG] Host:
2018-02-05 10:19:01 0 [DEBUG] Port:
2018-02-05 10:19:01 0 [DEBUG] Database name:
2018-02-05 10:19:01 0 [DEBUG] Database table:
2018-02-05 10:19:01 0 [DEBUG] Autodetect delimiters: Yes
2018-02-05 10:19:01 0 [DEBUG] Field Delimiter: comma
2018-02-05 10:19:01 0 [DEBUG] Text Enclosure:
2018-02-05 10:19:01 0 [DEBUG] Use file extension:
2018-02-05 10:19:01 0 [DEBUG] I'm Mac: No
2018-02-05 10:19:01 0 [DEBUG] Use file for configuration: No
2018-02-05 10:19:01 0 [DEBUG] Add extra fields: No
2018-02-05 10:19:01 0 [DEBUG] Skip first line: Yes
2018-02-05 10:19:01 0 [DEBUG] Overwrite existing data: No
2018-02-05 10:19:01 0 [DEBUG] Skip new items: No
2018-02-05 10:19:01 0 [DEBUG] Record name:
2018-02-05 10:19:01 0 [DEBUG] Lines per import: 1000
2018-02-05 10:19:01 0 [DEBUG] Time between imports: 5
2018-02-05 10:19:01 0 [DEBUG] Override system limits?: No
2018-02-05 10:19:01 0 [DEBUG] Maximum execution time:
2018-02-05 10:19:01 0 [DEBUG] Maximum amount of memory:
2018-02-05 10:19:01 0 [DEBUG] Maximum size of POST data in megabytes:
2018-02-05 10:19:01 0 [DEBUG] Maximum allowed size for uploaded files in megabytes:
2018-02-05 10:19:01 0 [DEBUG] Template ID: 9
2018-02-05 10:19:01 0 [DEBUG] Tags:
2018-02-05 10:19:01 0 [DEBUG] ==========
2018-02-05 10:19:01 1 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 1 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 1 [DEBUG] Use field value for field email
2018-02-05 10:19:01 1 [DEBUG] Use field value for field usergroup_name
2018-02-05 10:19:01 1 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 1 [DEBUG] Use field value for field requireReset
2018-02-05 10:19:01 1 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 1 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 1 [DEBUG] Process line 1
2018-02-05 10:19:01 1 [DEBUG] Find the user ID
2018-02-05 10:19:01 1 [QUERY] SELECT id FROM `jos3a_users` WHERE `email` = 'existing.user@email.com'
2018-02-05 10:19:01 1 [DEBUG] Load a row
2018-02-05 10:19:01 1 [DEBUG] Item existing.user@email.com exists, not updating because overwrite existing data is disabled
2018-02-05 10:19:01 1 [QUERY] SELECT * FROM jos3a_users WHERE `id` = '968'
2018-02-05 10:19:01 2 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 2 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 2 [DEBUG] Use field value for field email
2018-02-05 10:19:01 2 [DEBUG] Use field value for field usergroup_name
2018-02-05 10:19:01 2 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 2 [DEBUG] Use field value for field requireReset
2018-02-05 10:19:01 2 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 2 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 2 [DEBUG] Process line 2
2018-02-05 10:19:01 2 [DEBUG] Find the user ID
2018-02-05 10:19:01 2 [QUERY] SELECT id FROM `jos3a_users` WHERE `email` = 'new.user@email.com'
2018-02-05 10:19:01 2 [DEBUG] Load a row
2018-02-05 10:19:01 2 [DEBUG] Item new.user@email.com exists, not updating because overwrite existing data is disabled
2018-02-05 10:19:01 2 [QUERY] SELECT id FROM `jos3a_users` WHERE `email` = 'new.user@email.com'
2018-02-05 10:19:01 3 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 3 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 3 [DEBUG] Use field value for field email
2018-02-05 10:19:01 3 [DEBUG] Use field value for field usergroup_name
2018-02-05 10:19:01 3 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 3 [DEBUG] Use field value for field requireReset
2018-02-05 10:19:01 3 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 3 [DEBUG] Use field value for field skip
2018-02-05 10:19:01 3 [DEBUG] Process line 3
2018-02-05 10:19:01 3 [DEBUG] Find the user ID
2018-02-05 10:19:01 3 [QUERY] SELECT id FROM `jos3a_users` WHERE `email` = 'another.exiting.user@email.co.uk'
2018-02-05 10:19:01 3 [DEBUG] Load a row
2018-02-05 10:19:01 3 [DEBUG] Item another.exiting.user@email.co.uk exists, not updating because overwrite existing data is disabled
2018-02-05 10:19:01 3 [QUERY] SELECT * FROM jos3a_users WHERE `id` = '972'

I notice that the new user is still not being imported for the same reason, but again the SQL returns no results in PHPMyAdmin:
2018-02-05 	10:19:01 	2 	[QUERY] 	SELECT id FROM `jos3a_users` WHERE `email` = 'new.user@email.com'
2018-02-05 10:19:01 2 [DEBUG] Load a row
2018-02-05 10:19:01 2 [DEBUG] Item new.user@email.com exists, not updating because overwrite existing data is disabled
2018-02-05 10:19:01 2 [QUERY] SELECT id FROM `jos3a_users` WHERE `email` = 'new.user@email.com'

I also note that the log returns the same select query for the new user, while the existing users have a slightly different second query:
2018-02-05 	10:19:01 	1 	[QUERY] 	SELECT * FROM jos3a_users WHERE `id` = '968'

and
2018-02-05 	10:19:01 	3 	[QUERY] 	SELECT * FROM jos3a_users WHERE `id` = '972' 


Please help me, Obi-Wan Kenobi. You're my only hope...
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello,
It looks like your user table has all these three records already so CSVI is skipping the update of these users. Can you go to your phpMyAdmin, select your database and look for table #__users(#_ will be your table prefix). Do you see these email ids in there? or send me a private message of your database access details and your admin access details. I will take a look.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hi Tharuna,

No, the email ID for the new user isn't in the table at all. I've just double checked this now by looking through all the records, but previously I ran the query from the log directly on the table:
SELECT id FROM `jos3a_users` WHERE `email` = 'new.user@email.com'

and for completeness:
SELECT * FROM `jos3a_users` WHERE `email` = 'new.user@email.com'

but that email address is definitely not in there.

I also tried:
select * from jos3a_users where name like '%@%'

(because the users I'm adding all have their email address as the username), but the new one isn't there and the two existing ones are.

(as before, I've amended the email address, but there's definitely no user record in that table. Should I be looking elsewhere?)

Is there any harm in me re-importing that patch file, or is there some way I can check that it loaded correctly?
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello,
(as before, I've amended the email address, but there's definitely no user record in that table. Should I be looking elsewhere?)

No, you are looking at the right place. Can you send me the access details as requested in my previous post? I will take a look and see what i can find.

Is there any harm in me re-importing that patch file, or is there some way I can check that it loaded correctly?

There is no harm in reloading the patch file. You should be seeing Success message if the patch has been copied to the correct location when you load it.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hello Chris,

Just wanted to chime in that I was able to reproduce your issue before the patch and after the patch the import of the user worked as expected. After you load the patch again, check if the file updated is located at plugins/csviaddon/users/com_users/model/import/user.php. Line 105 of this file should say
if ($this->userTable->get('id', 0) > 0 && !$this->template->get('overwrite_existing_data'))


Let me know what you find.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Odd. I've got that line at 107.
  1. more than a month ago
  2. RO CSVI
  3. # 11
Accepted Answer Pending Moderation
Hello,
Thank you for sending the requested details but unfortunately the FTP details don't seem to work and it gets me Timeout error. Can you also send me the link to access your test site database? That is missing in the details you had sent.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hello,
I took another look at your test site and it looks like you have missed to load the patch file in there after CSVI update. I loaded the patch file and ran the import. Now the import works as expected and says Missing password field. You need to set the password field as that is a required field for creating a user. Since you have set Overwriting existing data to No, existing users won't be updated. Can you try the import on your test site and let me know?
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 13
Accepted Answer Pending Moderation
Hi Tharuna,

I'm pretty confident I didn't miss the patch, but the log entries have been truncated so I can't check.I'll try again on another test site. is it your belief that all that is required for this to work is to upgrade to 7.4.1 and to apply the patch file?

I've updated the user import template to include the password now too, thanks.
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
Thanks for your patience with this issue - I think I've got it sorted.

I think I installed CSVi, then the patch, then later realised I needed to update the VirtueMart addon.

This time, I installed CSVi, then the addon, then the patch and it appears to have updated as expected.
  1. more than a month ago
  2. RO CSVI
  3. # 15
Accepted Answer Pending Moderation
Hello,
Thanks for your patience with this issue - I think I've got it sorted.

Glad to know that issue is sorted. Please leave us a review on Joomla Extension Directory :)

This time, I installed CSVi, then the addon, then the patch and it appears to have updated as expected.

Yes this is the correct order so the patch gets applied on latest version of the file.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 16
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!