Save user error in Joomla user manager

  • Posts: 127
  • Thank you received: 1
9 years 2 months ago #235055

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.5.0
-- PHP version -- : 5.5.21
-- Browser(s) name and version -- : Safari 9.0.1
-- Error-message(debug-mod must be tuned on) -- : Save failed with the following error: Duplicate entry 'This email address is being protected from spambots. You need JavaScript enabled to view it.' for key 'user_email' SQL=UPDATE `#__hikashop_user` SET `user_email`='pfdted@gmail.com',`user_cms_id`='105480' WHERE `user_id`='279'

Hello,

The attached error is occurring when trying to save a user using the Joomla user manager. I have tried disabling the HikaShop user synchronization plugin and this removes the error, but I think this plugin needs to stay enabled for proper synchronization. I have other plugins that work with the Joomla user manager and I disabled them first to see if they were causing the issue, but they were not, so the issue looks to be with the HikaShop synchronization plugin and managing users using the user manager. Any help is greatly appreciated. Thank you.

Mike

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

  • Posts: 83930
  • Thank you received: 13586
  • MODERATOR
9 years 2 months ago #235114

Hi,

That would indicate a synchronization problem with the user data.
Go in the HikaShop configuration and click on the "check database" button. That should run a resynchronization of the user data, and hopefully you won't get the error anymore.

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

  • Posts: 127
  • Thank you received: 1
9 years 2 months ago #235123

Hello,

I have re-enabled the plugin, then used the "Check Database" button, but this did not solve the issue. I tried saving a user again and the same SQL error was displayed.

Mike Hermary

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

  • Posts: 83930
  • Thank you received: 13586
  • MODERATOR
9 years 2 months ago #235138

Hi,

So you have the error with any user ?
Not only one ?
Do you have real orders on your website already ?
If not, an easy solution would be to: empty (not delete) the table hikashop_user via your phpmyadmin and then run a "check database" again.

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

  • Posts: 127
  • Thank you received: 1
9 years 2 months ago #235165

Hello,

It only applies to certain users. I am assuming they are users that have made purchases using the online store, though they were purchases from Virtuemart and not HikaShop. This website is an upgrade and the Virtuemart data was imported. If I empty the HikaShop users table, will the orders table be affected at all?

Mike

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

  • Posts: 83930
  • Thank you received: 13586
  • MODERATOR
9 years 2 months ago #235168

Hi,

So maybe it was a problem with the imported data.
If you empty the hikashop_user table, you'll loose the link between the user accounts and the orders. You'll still have the orders in the backend, but logged in others won't be able to see their previous orders and you won't be able to email the users for their order when you edit an order in the backend.

What that error means is that there is another entry in the table hikashop_user with the email address "This email address is being protected from spambots. You need JavaScript enabled to view it." than the one with the id 279.
Search for both entries in that table with your phpmyadmin and provide a screenshot of the data of both and tell us which one is linked to orders in the hikashop_order table (with the same user_id in the order_user_id column).
I should then be able to give you a MySQL to run to fix that for all the users with the problem hopefully.

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

  • Posts: 127
  • Thank you received: 1
9 years 1 month ago #235944

Hello,

I searched for the user_cms_id of 105480 and there are two records using the same CMS ID. There are a total of 15 records with duplicate CMS IDs. What can be done to fix this issue? Any help is greatly appreciated. Thank you.

Mike

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

  • Posts: 83930
  • Thank you received: 13586
  • MODERATOR
9 years 1 month ago #236168

Hi,

I think that such query should do the job:

DELETE t1.*
FROM
  #__hikashop_user t1 INNER JOIN (SELECT user_cms_id
                           FROM #__hikashop_user
                           GROUP BY user_cms_id
                           HAVING COUNT(*)>1) t2
  ON t1.user_cms_id = t2.user_cms_id ANDuser_cms_id > 0;
Please make a backup of the table before and make sure that you replace #__ with the actual prefix of your tables.

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

  • Posts: 83930
  • Thank you received: 13586
  • MODERATOR
9 years 1 month ago #236169

PS: you need to run that MySQL query through your PHPMyAdmin of course.

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

  • Posts: 127
  • Thank you received: 1
9 years 1 month ago #236252

Hello,

I ran the query on the table usingPHP MyAdmin, but I get this error: #1052 - Column 'user_cms_id' in on clause is ambiguous. Any ideas?

Mike

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

  • Posts: 83930
  • Thank you received: 13586
  • MODERATOR
9 years 1 month ago #236266

Hi,

Try like that:

DELETE t1.*
FROM
  #__hikashop_user t1 INNER JOIN (SELECT user_cms_id
                           FROM #__hikashop_user
                           GROUP BY user_cms_id
                           HAVING COUNT(*)>1) t2
  ON t1.user_cms_id = t2.user_cms_id WHERE t1.user_cms_id > 0;

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

  • Posts: 59
  • Thank you received: 0
8 years 7 months ago #252240

Hi,

I have the same problem on saving from user manager.
My situation it's a bit different: I developed the website with HikaShop so I didn't import data from other ecommerce.
My saving problem is with all users and the shop is online with orders and customers.
If I disable the synchronization plugin everything is ok.
I didn't try to execute the query you wrote, is it good for my issue too?

Regards,
Simone

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

  • Posts: 83930
  • Thank you received: 13586
  • MODERATOR
8 years 7 months ago #252251

Hi,

I would recommend to try that MySQL query yes.
It won't break anything. However, it's possible that some customers might loose access to some of their orders from the frontend orders listing. So I would recommend to do a backup of the database before.

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

  • Posts: 59
  • Thank you received: 0
8 years 7 months ago #254255

Hi,

thank for your reply, I tried the query but it deleted nothing.
So if I try to change anything in user manager I still receive the error.
Do you have any other suggestion?

Simone

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

  • Posts: 83930
  • Thank you received: 13586
  • MODERATOR
8 years 7 months ago #254260

Hi,

Try clicking on the "check database" setting of the HikaShop configuration. Maybe your problem is just that the synchronization wasn't done with the Joomla user accounts.
I don't have any other idea besides that.

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

  • Posts: 59
  • Thank you received: 0
8 years 5 months ago #257282

Hi,

I still have this issue on user saving if the synchronization plugin is enabled. I tried the "check database" but it didn't work.
The real problem of this situation is that users can't update/recover password.
I also tried the MySQL query you mentioned without success.

Could I give you access to the website/FTP to check it?
Or you have any other suggestion?

Simone

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

  • Posts: 83930
  • Thank you received: 13586
  • MODERATOR
8 years 5 months ago #257313

Hi,

If you still have the problem, then it could be that the database structure has been messed up by something.
Please provide a backend access, a FTP access AND a PHPMyAdmin access so that we can also look at your database.
We could also need the precise procedure to reproduce the problem and a link to this thread.
You can send all that through our contact form:
www.hikashop.com/support/contact-us.html

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

  • Posts: 83930
  • Thank you received: 13586
  • MODERATOR
8 years 5 months ago #257524

Hi,

We got all your accesses and had an extensive look at the problem today.
First, on your copy of your website, I didn't get the same error message as you. I only got the error message: "Save failed with the following error: "
The error is apparently linked to the line:

if(@$_REQUEST['ctrl']!='checkout') return false;
in the file plugins/system/hikashopuser/hikashopuser.php
Actually, that line has been removed in recent versions of HikaShop as it was not necessary and created some issues in some cases.
Removing that line fixed the error message on your copy website.
Updating to the latest version of HikaShop would have also fixed the problem.

The following user(s) said Thank You: simonev

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

  • Posts: 59
  • Thank you received: 0
8 years 5 months ago #257585

Hi Nicolas,

thank you really so much for support, it's superb.
Yes the problem was on saving with error you mentioned. Sorry if I didn't explain it well.
I forgot to update Hikashop, I didn't receive update notification after 2.6.2.
Thank you again Nicolas, have a good day.

Regards,
Simone

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

Time to create page: 0.153 seconds
Powered by Kunena Forum