1. jayrigby
  2. Support
  3. Tuesday, March 03 2015, 06:54 AM
Hi there,

I am trying to update our member data but it is quite complicated.

I tried with the import plugin but there is an issue.

We have a field called member_id in easy profile - this is the value for a user that will not change on either the website or our internal database.

To update the website we need to base our user lookup on member_id not email address because the email address may have changed - so when we do the import the user would not be found and a new user would be created.

We just want to update several fields, including email address, from a cvs file based on member_id not email address.

Please can you help!?

Best wishes,
Jay
Accepted Answer
admin Accepted Answer
Admin
Hi,
Import plugin check if user exists by email, this because Joomla required unique email address for each user.

The query to check this is into file /plugins/jsn/userimport/userimport.php at line 240, so you can change this line from
$query->select('id')->from('#__users')->where($db->quoteName('email').' = '.$db->quote($importUser['email']));

to
$query->select('id')->from('#__jsn_users')->where($db->quoteName('member_id').' = '.$db->quote($importUser['member_id']));


When user exists our plugin not write fields like email or username, so to enable this code this line after line 270
if(isset($importUser['email'])) $query->set($db->quoteName('email').' = '.$db->quote($importUser['email']));


Email and Name (or firstname) are required, if you want to remove email from required field you need to delete (or comment) from line 145 to line 149

NOTE: This code is not tested and not supported and require PHP Knowledge.
  1. more than a month ago
  2. Support
  3. # Permalink


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.