1. itadminguy
  2. General
  3. Thursday, January 05 2017, 01:08 AM
The import plugin requires the email field to be used in the csv file.

But some of my users have the same email address.

When I create my CSV it lists the cumulative creation of all prior csv entries. Assume my csv file has say top row of fields and 20 user rows. Assume 5 of those users have the same email address.

Before I import the CSV using the import plugin, I delete the first 19 user rows (Why? because the csv is old and some users may have changed their username, firstname, lastname, etc...)

So I want to import the new 20th row only with email [email protected], firstname (Joe), and lastname (smith).

When I import the csv, there is only the top row of fields and 1 row (the 20th row).

The problem is that I have four other uses with [email protected]. When I import the csv, it imports into the profile of one of my other four users with [email protected] and it odes not import into the Joe Smith profile.

Does the new backend import feature allow import by user_id?

Can email be changed to user_id so that my 20th row will always import to the user_id and not to the email address?

Thanks
admin Accepted Answer
Admin
Hi,
this is not possible because Joomla not allow this. Of course you can force this by add users with some tools or via DB, but this can create many problems (also security problems).

Email and Usernames must be unique for each user.
  1. more than a month ago
  2. General
  3. # 1
itadminguy Accepted Answer
Thanks for fast response.

I can solve my problem a different way if Easy Profile allows for saving a user object from a form data field alias.

The documentation to save a field is as follows:

Set Value of User Object

<?php
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=JsnHelper::getUser($joomlaUser->id);
$user=JsnHelper::getUser();
$user->field_alias=value;
?>

This code will save the "value" but only if I hard code an actual name for the "value".

******************************

If I hard code a "value" in an form program field alias of best_friend_name=Joe, then Joe is saved to the Easy Profile database.

<?php
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=JsnHelper::getUser($joomlaUser->id);
$user=JsnHelper::getUser();
$user->best_friend_name="Joe";
?>



My Question.

Is there a way to change "value" to a form input field instead of having to hard code the word "Joe."

My form On Load HTML is as follows:

<?php
$user =& JFactory::getUser();
$user=JsnHelper::getUser();
$form->data['best_friend_name'] = $user->best_friend_name;
?>

If I have saved Joe in the database, when the HTML loads then "Joe" is displayed.

In my form I want to change the name in the field input from Joe to Sam. But in order to save the name Sam, I have to change to something like this:


<?php
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=JsnHelper::getUser($joomlaUser->id);
$user=JsnHelper::getUser();
$user->best_friend_name=['best_friend_name'] ;
?>

But this is the line I cannot get to work properly. Nothing is saved in the Users field for "best_friend_name".
$user->best_friend_name=['best_friend_name'] ;

****************
Does the Easy Profile documentation allow for changing this

$user->best_friend_name="Joe";

to a form input that saves any name in the field input from the form like this

$user->best_friend_name=['best_friend_name'] ;

***************************


I want to be able to save any name in the best_friend_name form field in to the user profile in Easy Profile.

Thanks for your help.
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
Hi,
sorry but I not understand, JsnUser object does not generate HTML input. it extends Joomla JUser object.

Anyway if you want to store information you need to add $user->save() function, docs about this at https://api.joomla.org/cms-3/classes/JUser.html#method_save
  1. more than a month ago
  2. General
  3. # 3
itadminguy Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 4
admin Accepted Answer
Admin
This question is too long, therefore I read quickly (and I can't be precise in the reply). Also, now you are a free member and professional support is expired.
Keep in mind that also for paid members we does not provide custom solutions, we support our product based on what it does. Of course, if possible we always try to point our customer on the right way.

Some point:
Note, I do still need an answer to my reply about getting my form input "best_friend_name" to save to the easy profile.
Easy Profile does not generate any input, it extends Joomla user management, registration form is the same of Joomla with many improvements.

The problem is that Easy Profile is wonderful, but the documentation for getting post-registration user data into the Easy Profiles states that you have to define a hardcoded "value" to insert data into the fields
Easy Profile extends Joomla user management, so the way to make this is the same without Easy Profile. we can write a documentation for our product but not for Joomla.

About your code:
your question is not clear and I have many difficulties to understand what you want to do, seems that you want to change input value in a form, but you write a function to load and save information with a user object.
- where did you plan to put this code (in which file) ?
- which form ?

also you wrote:
The documentation to save a field is as follows:

Set Value of User Object
<?php
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=JsnHelper::getUser($joomlaUser->id);
$user=JsnHelper::getUser();
$user->best_friend_name="Joe";
?>

But to save user you need to see "Save User" section and not "Set Value of User Object", see screenshot.
Attachments (1)
  1. more than a month ago
  2. General
  3. # 5
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.