Bug in J! / EB Field Mapping returns name from _users table not _eb_categories

  • OTWD
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
1 year 9 months ago - 1 year 9 months ago #159287 by OTWD
Using J!4.3.3. and EB4.5.0
I created a Joomla Custom Registration field
name = name
Query = SELECT name AS value, name AS text FROM #__eb_categories WHERE parent != 0
This returns all the names of the child categories and works well when testing in phpMyAdmin
e.g Kildare, Laois, Offaly
I then map this J!Reg field to EB custom fields using the userprofile plugin.
However as there is a name field in the #__users table the query returns the users concat name e.g "John Smith" rather than the name "Kildare" from the #__eb_categories table!
How can i return the name of the category?

 

Success consists of going from failure to failure without loss of enthusiasm.
Last edit: 1 year 9 months ago by OTWD.

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #159291 by Tuan Pham Ngoc
I don't understand your question. If you setup the custom fields in Users, then not sure how it is related to Events Booking here. Could you please explain more details because I still don't really understand what's the actual issue here

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • OTWD
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
1 year 9 months ago #159309 by OTWD
Thanks Tuan
Instructions to replicate the issue:
  1. In EB Setup Category and Sub Category e.g Kildare (Parent), Orchard House (Child of Kildare)
  2. Go to Joomla > Users > Fields > New field (Type: sql, Name: name, Label: Category Name, Query: SELECT name AS value, name AS text FROM #__eb_categories WHERE parent != 0
  3. Test that the J! user field loads your Sub Category (i.e "Orchard House")
  4. Assign the "Category Name" value to a registered user in Joomla (e.g John Smith)  > Click Save.
  5. Go to plugins and activate Events Booking - Userprofile
  6. Go to EB Custom fields > New > Text field > Field Mapping > Select Field "Category Name" > Show custom field in All
  7. Setup event with registration access = "Registered"
  8. Login to book the event with the registered user (John Smith) - you will see that the Custom field will load the name field fom the #__users (John Smith)  table NOT  #__eb_categories (Orchard House)
If you change the query in the J! users field to SELECT id AS value, name AS text FROM #__eb_categories WHERE parent != 0 then it does load the id value of the EB subcategory in the EB mapped field - however I want to load the Category Name in the EB mapped field - it seems use of name AS value messes it up.
Can you replicate this?
 

Success consists of going from failure to failure without loss of enthusiasm.

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #159311 by Tuan Pham Ngoc
I have no clue why it is working like that. For this, I think you can submit a support ticket sending us:

1. Super admin account of the site

2. A user account which can be used to login, perform registration and see this error

3. Link to registration form

I will check to see why the issue happens and get it sorted

Regards,

Tuan
The following user(s) said Thank You: OTWD

Please Log in or Create an account to join the conversation.

  • OTWD
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
1 year 9 months ago #159323 by OTWD
SOLVED
I was following instructions here docs.joomla.org/SQL_form_field_type
" name (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute. "

So dont use name = "name" in J! User Custom fields, otherwise they get confused in EB - change to e.g name = "category-name" then it works. thanks @tuan

Success consists of going from failure to failure without loss of enthusiasm.

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #159329 by Tuan Pham Ngoc
Yes. There are some reserved names use by Events Booking to get data from Joomla user account, so please don't use these reserved names:

- name
- username
- email

Except the above names, you can use any name for name of the user custom fields

Regards,

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc