- Posts: 52
- Thank you received: 0
Please include [USER_ID] tag in next release
- noel adams
- Topic Author
- Offline
- Senior Member
Could you please include the code to allow the [USER_ID] in SQL custom fields in the next release. You released a version of sql.php held in administrator/components/com_eventbooking/libraries/rad/form/field that had this tag but the latest version overwrote it.
Thank you,
Noel Adams
Please Log in or Create an account to join the conversation.
- OTWD
- Offline
- Platinum Member
- Posts: 330
- Thank you received: 5
SELECT `email` AS value,`email` AS text FROM `nipd_eb_registrants` WHERE `user_id` = "3371" AND `event_id` = "2027" ;
WORKS
BUT
SELECT `email` AS value,`email` AS text FROM `nipd_eb_registrants` WHERE `user_id` = [USER_ID] AND `event_id` = "2027" ;
DOESN'T
Success consists of going from failure to failure without loss of enthusiasm.
Please Log in or Create an account to join the conversation.
- Joshua Goldberg
- Offline
- Junior Member
- Posts: 28
- Thank you received: 0
I badly need this one.
Thanks!
Please Log in or Create an account to join the conversation.
- Joshua Goldberg
- Offline
- Junior Member
- Posts: 28
- Thank you received: 0
I figured out how to fix it if you need it quickly while you wait for Tuan to implement it:
In administrator/components/com_eventbooking/libraries/rad/form/field.php
after:
add:protected $eventId = null;
protected $user = null;
Then down below that (same file) in this block:
public function __construct($row, $value = null)
{
$this->name = $row->name;
$this->title = $row->title;
$this->description = $row->description;
$this->row = $row;
$this->value = $value;
add the following line:
last but not least, after this line in administrator/components/com_eventbooking/libraries/rad/form/field/sql.php :$this->user = Factory::getUser()->id;
$this->query = str_replace('[EVENT_ID]', (int) $this->eventId, $this->query);
add this line:
$this->query = str_replace('[USER_ID]', (int) $this->user, $this->query);
I hope this helps!
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
As I said before, this will only work for user who registered in the frontend of your site. In case admin editing a registration record for example, that user id will be ID of the admin users and you would get wrong result
Tuan
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- noel adams
- Topic Author
- Offline
- Senior Member
- Posts: 52
- Thank you received: 0
I already had the code to implement [USER_ID] thank you. The reason I placed the post on wishlist was to avoid the need to redo it everytime I updated Event Booking.
Cheers,
Noel.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- Manfred Lilge
- Offline
- New Member
- Posts: 17
- Thank you received: 0
A very simple SQL field "SELECT "1" AS value, [USER_ID] AS text" always returns "0" for the user_id.
I'm on EB v3.17.2 and Joomla v4.
Please Log in or Create an account to join the conversation.
- Manfred Lilge
- Offline
- New Member
- Posts: 17
- Thank you received: 0
joomdonation.com/forum/events-booking-ge...r-fields.html#117585
Would be great to have this solution added to the regular releases, if not done yet.
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.