Additional entry fields with juser-plugin?

kissinger

Member
Hallo!

I use the PHP plugin "juser" to register new users in frontend. Now I would like to have additional input fields. That does not seem to work properly if I add fields to the form.

Is there a way for the registration of new users with "juser" to store additional information?

Thank you!
 
First a quick note on wording: "Juser" is ... a form plugin, not a PHP plugin. The PHP plugin is another type of plugin that allows you to run scripts on loading or submitting a form. I just say this to avoid confusion.

Back to your issue, if adding new fields does not work properly, it is probably because you linked your registration list/form to the #__users table of Joomla, which is the good way to go. However, this table being a core Joomla table, it is not recommended to alter its structure by adding new fields.
The proper way to go is to create a new list pointing to a database table you can call "users_extra" for instance, add the desired addtional fields in this list + a "user_id" field (Beware: a plain "field" element, not a "user" one!), set to hidden and that will be used to make a join between your first registration list to this new one.

If you read French, I wrote an - almost - complete tutorial on how to use this plugin. The link to this tutorial is in my signature.
 
Hallo jfquestiaux,

I have now done like in your instructions, but when I want to save the join, a error message appears without comment.

And in the user form is not new field to see.

Here the message:

error.png


Here the join:

error1.png

And here the entry in the fabrik-table "...fabrik_joins":

error2.png
 
Your join is looking ok.
I just tested, it's working on my site without error.

Do you have Joomla's error reporting set to maximum?
Can you see a new group, something like ect_users-[ect_extra_fields]?
Is ect_extra_fields id element published, writable?
ect_extra_fields user_id is field+integer (or dbjoin to etc_users), published, writable?
 
Hallo troester,

Yes, error-reporting is on "maximum".
Yes, there is a new group User-[ect_extra_fields] in the group-list, but this group is empty.
Yes, the field id (plugin internealid) is published.
Yes, the user_id - field is integer (11), is published.
What do you mean with "writable"?

Thank you!
 
Hallo!

The settings of all fields in both tables are "public".
But if I save the join I get "Error".
Or there are more accecc-settings?

Here the setting for the field which I want add to the User-Registration-form:

access.PNG
 
The user-list and the extra-field-list have also the access-level "public".
And if I for testing change the access-level of the menu-item to "public" and save the join I get the same Error.
What's the matter?
 
Well, I just read you first post again and in fact there is an error with joins that I reported a day or two ago.
The problem is : the join is created but there are no elements in the joined group.

You can try to copy (not move!) the elements from the "parent" group (extra_fields) to the joined group until this issue is solved.
 
Hallo!

I copied the field "Verif-email" in the new joined group and the field appears now in the form.
But if I want to save the new user I get this error:

Fatal error: Call to a member function get() on a non-object in .../components/com_fabrik/models/join.php on line 183

The data of the new user are saved but not the new field in his table.
 
You need to copy more than one field.
If you followed my tutorial, you should at least have the following fields:
  • id
  • date_time
  • user_id
  • verif_email
The error probably comes because you don't have a "user_id" field to make the join with the "id" in the users table.
 
If I copied all 4 fields I get this error:

1054 Unknown column 'date_time' in 'field list' SQL=SELECT SQL_CALC_FOUND_ROWS DISTINCT `ect_users`.`id` AS `ect_users___id`, `ect_users`.`id` AS `ect_users___id_raw`, `ect_users`.`name` AS `ect_users___name`, `ect_users`.`name` AS `ect_users___name_raw`, `ect_users`.`username` AS `ect_users___username`, `ect_users`.`username` AS `ect_users___username_raw`, `ect_users`.`email` AS `ect_users___email`, `ect_users`.`email` AS `ect_users___email_raw`, `ect_users`.`password` AS `ect_users___password`, `ect_users`.`password` AS `ect_users___password_raw`, `ect_users`.`block` AS `ect_users___block`, `ect_users`.`block` AS `ect_users___block_raw`, `ect_users`.`registerDate` AS `ect_users___registerDate`, `ect_users`.`registerDate` AS `ect_users___registerDate_raw`, `ect_users`.`lastvisitDate` AS `ect_users___lastvisitDate`, `ect_users`.`lastvisitDate` AS `ect_users___lastvisitDate_raw`, `ect_users`.`activation` AS `ect_users___activation`, `ect_users`.`activation` AS `ect_users___activation_raw`, `ect_users`.`lastResetTime` AS `ect_users___lastResetTime`, `ect_users`.`lastResetTime` AS `ect_users___lastResetTime_raw`, `ect_users`.`resetCount` AS `ect_users___resetCount`, `ect_users`.`resetCount` AS `ect_users___resetCount_raw`, ``.`id` AS `___id`, ``.`id` AS `___id_raw`, ``.`date_time` AS `___date_time`, ``.`date_time` AS `___date_time_raw`, ``.`user_id` AS `___user_id`, ``.`user_id` AS `___user_id_raw`, ``.`verif_email` AS `___verif_email`, ``.`verif_email` AS `___verif_email_raw`, `ect_users`.`id` AS slug , `ect_users`.`id` AS `__pk_val` FROM `ect_users` LIMIT 0, 10

and the list/form not appears
 
I think there is a problem because your "extra fields" don't seem to record to a database.
You can't just create a form for "extra fields". You need to create a list, then join this list to the users list.
 
I first created the User-List/Table with the juser-plugin, this is ok.
Then I created the List Extra-Fields and joined it with the Extra-Field-List and get the error.
I tried also join other lists with the Extra-List, every time: error.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top