Need help with Joomla? We are available for hire to help with Joomla customization, upgrades, maintenance, and custom development.
Explore our services

V5.8.0 erroneous mail address of registrant

  • RoyanRandeau
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 hours 55 minutes ago #179007 by RoyanRandeau
V5.8.0 erroneous mail address of registrant was created by RoyanRandeau
Hi.in version 5.8.0, when a manager, with sufficient rights, uses the back-end to register for an event a person already known in joomla database, then the mail that is stored in the registrant table is now the mail of the administrator and no longer the mail of the person being registered .See in administrator/components/com_eventbooking/controller/controller.php, in public function get_profile_data()
At the start of the function, new lines have been added where the $user variable now get initialised which has a side effect at the end of the function when testing the $user variable to insert the mail address.
I modified the code to no longer alter the content of $user variable. This seems to fix the issue.public function get_profile_data()    {         $user1 = $this->app->getIdentity(); /**************remplaced $user by $user1 ***********/         if (!$user1->authorise('eventbooking.registrantsmanagement', 'com_eventbooking'))   /**************remplaced $user by .$user1 ***********/        {            throw new RuntimeException('You do not have permission', 403);        }
.
.
.
.if (empty($user))            {                /* @var User $user */                $user = Factory::getContainer()->get(UserFactoryInterface::class)->loadUserById((int) $userId);            }             $data = $user->email;
.
.
Jean Poumailloux

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

More
7 hours 25 minutes ago #179008 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic V5.8.0 erroneous mail address of registrant
Hi Jean

The right code is:
Code:
public function get_profile_data() { if (!$this->app->getIdentity()->authorise('eventbooking.registrantsmanagement', 'com_eventbooking')) { throw new RuntimeException('You do not have permission', 403); } $userId = $this->input->getInt('user_id', 0); $eventId = $this->input->getInt('event_id'); $data = []; if ($userId && $eventId) { $rowFields = EventbookingHelperRegistration::getFormFields($eventId, 0); $data = EventbookingHelperRegistration::getFormData($rowFields, $eventId, $userId); } if ($userId && !isset($data['first_name'])) { //Load the name from Joomla default name /* @var User $user */ $user = Factory::getContainer()->get(UserFactoryInterface::class)->loadUserById((int) $userId); $name = $user->name; if ($name) { [$firstName, $lastName] = EventbookingHelper::callOverridableHelperMethod( 'Registration', 'detectFirstAndLastNameFromFullName', [$name] ); $data['first_name'] = $firstName; $data['last_name'] = $lastName; } } if ($userId && !isset($data['email'])) { if (empty($user)) { /* @var User $user */ $user = Factory::getContainer()->get(UserFactoryInterface::class)->loadUserById((int) $userId); } $data['email'] = $user->email; } echo json_encode($data); $this->app->close(); }

I will have this included in next release 5.8.1 of the extension

Regards,

Tuan

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

More
7 hours 24 minutes ago #179009 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic V5.8.0 erroneous mail address of registrant
Or you can get the attached zip file, unzip it, upload the received file to administrator/components/com_eventbooking/controller folder to get the issue fixed while waiting for new release

Regards,

Tuan

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