Guest Post-Checkout Registration SQL error.

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
4 years 1 week ago #326219

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.22
-- PHP version -- : 7.3.24

I am launching a site update tonight without one of the improvements I wanted to make because of an error that has popped up.

I had hoped to incorporate Hikashop's Guest Checkout along with a site redesign and update from Hikashop 4.2 . BTW, The documentation about how the Guest Checkout really functions its really skimpy, but I finally found enough description to understand how it actually works, and am pretty satisfied with that process.

However, once I configured it, the link provided on the Guest receipt leads back to the registration form (with the latest reCaptcha activated) but when I submit the form, it generates a SQL error that is reported through Joomla's messaging system.

The error reads that there is a syntax error that occurring "near ' 2)' on line 3", but includes no URL. Because the page logs the error message but doesn't stop processing I don't know where the message is occurring, and I can't get the full Query text. The "line 3" part seems particularly unusual.

Turning on Debug lists SQL queries, but I can't identify this error in them. Manually tracking it, I learned that a Joomla User record is created (id = 0), but before it gets re-numbered as a proper Joomla User, Hikashop's user class's guestRegister method is killed, and the form redraws - without even deleting the Joomla User record.

I've run the database checks on both Joomla and Hikashop.

Until I can squash that bug, I can't activate Guest purchases. That's not enough to delay the update, but I'd like to make real Guest purchases available.

If you need to visit the site, please wait until the weekend is over and my transfer/update is complete.

Meanwhile, any ideas?

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
4 years 4 days ago #326285

Hi,

The first thing to do here is to do this change in the code of Joomla:
www.hikashop.com/support/forum/product-c...eld-list.html#304882
Then, reproduce the error, and the error will display the full MySQL query which generates the error.
That will allow us to understand where the problem comes from.
Also, when you reproduce the issue, do so after activating both the error reporting and the debug mode settings of the Joomla configuration.
That way, when the error happens, you should also get the call stack of the PHP files leading to the MySQL error which will help further pin point the problem.

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

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
4 years 4 days ago #326322

Thank you for the guidance.

I haven't had the to apply all the instructions yet, but the SQL query at issue is

INSERT INTO `xisu6_user_usergroup_map` (`user_id`,`group_id`) VALUES (, 2)

That will help narrow it down.

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

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
4 years 4 days ago #326328

What appears to be happening is that when the new Joomla User is successfully created from the Hikashop Order info, Joomla assigns it an ID value of 0. The SQL error comes when attempting to associate the User Group Map, since the $this->id value being tossed around in the code is blank, not 0.

Adding (int) to the $this->id variable in /libraries/src/Table/User.php around line 372 (where the groups are mapped to the user one at a time) makes that part work, but the User's ID number never gets changed from 0.

That's as far as I have gotten, so Guest Registration is still not working for me.

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

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
4 years 4 days ago #326332

I have a sneaking suspicion.

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

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
4 years 4 days ago #326335

I found it. Not a code issue. Apparently, the indexes for the Users table got hosed, along with the AutoIncrement setting. Joomla's Database tools apparently check filenames, but not indexes.

Once I rebuilt the index and the setting the user ID value was correct and the Guest User registered properly


Thank you for your help. Even if the issue had nothing to do with HikaShop, your suggestion did lead me to the solution.

The following user(s) said Thank You: Mohamed Thelji

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

Time to create page: 0.135 seconds
Powered by Kunena Forum