VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: ymedia on March 04, 2015, 02:01:28 AM

Title: Registering with existing username displays no error message
Post by: ymedia on March 04, 2015, 02:01:28 AM
Hey guys,

First post so sorry if I'm doing it wrong, but this is probably worth bringing to attention:

(Using Joomla 3.3.6 and virtuemart 3.0.6)

Whenever a user registers with a username that already exists, the page just refreshes with no error message.

It's happening on a site I'm working on now, and it happens on your demo site http://demo.virtuemart.net/account if you try to register with the username 'demo' (because it already exists).

I also tried putting the <jdoc:include type="message" /> above <jdoc:include type="component" /> (a commonly suggested fix) but it doesn't seems to work.

I had a search for this but couldn't find anything relevant to joomla 3.x

Looking forward to your response
Title: Re: Registering with existing username displays no error message
Post by: GJC Web Design on March 04, 2015, 11:51:36 AM
afaik VM has done this since VM2 days .. and yes - not ideal...
Title: Re: Registering with existing username displays no error message
Post by: julos0877 on March 04, 2015, 17:19:41 PM
I opened a topic last year for this : http://forum.virtuemart.net/index.php?topic=127466.0

But no answer and no solution yet.
Title: Re: Registering with existing username displays no error message
Post by: ymedia on March 04, 2015, 22:24:00 PM
Damn, seems like a pretty big issue!

Does anyone have any good workarounds?
Title: Re: Registering with existing username displays no error message
Post by: jenkinhill on March 04, 2015, 23:40:31 PM
I never see an issue like this as none of my sites require registration, all work as guest checkout only because I want the customers to buy as easily & simply as possible.

But I have remembered this:  http://forum.virtuemart.net/index.php?topic=115425
Title: Re: Registering with existing username displays no error message
Post by: GJC Web Design on March 05, 2015, 00:43:35 AM
I think the best system would be a live check of the username and email as they are filled (by ajax)

On another non VM project I am using com_ajaxregister and this works really well  http://www.sakic.net/products/ajax_register/documentation/

It does a quick DB query by ajax as soon as you leave the field

http://www.investorenmagazin24.de/index.php?option=com_ajaxregister&view=registration&Itemid=148

try test1 as benutzer or test1@gjcwebdesign.com  as email

if something like this could be developed for VM it would be ideal
Title: Re: Registering with existing username displays no error message
Post by: ymedia on March 05, 2015, 01:39:17 AM
Thanks heaps for the response guys,

I've tried everything suggested and unfortunately am still having no luck.

If there's any other ideas you might have I'm all ears!

It seems like it's been a bit of an issue for a while.
Title: Re: Registering with existing username displays no error message
Post by: lindapowers on March 05, 2015, 10:57:47 AM
One page checkout by rupostel includes this feature at least on registration from checkout. On pre registration I have not tested.

Ask Stan to make sure https://www.rupostel.com/
Title: Re: Registering with existing username displays no error message
Post by: Milbo on March 05, 2015, 18:29:33 PM
I wonder, this should have been fixed since 3.0.4
Title: Re: Registering with existing username displays no error message
Post by: Milbo on March 05, 2015, 18:54:00 PM
Thank you, found.
Title: Re: Registering with existing username displays no error message
Post by: ymedia on March 05, 2015, 22:47:49 PM
Thanks again for your replies,

I've messaged Rupostel and now awaiting his reply.

I'll keep you all posted
Title: Re: Registering with existing username displays no error message
Post by: julos0877 on March 09, 2015, 11:22:03 AM
Hello Milbo,

What do you mean when you write "Tank you, found"?
Do you mean, we need to use the One Page Checkout for VirtueMart to solve this problem?
Title: Re: Registering with existing username displays no error message
Post by: Milbo on March 09, 2015, 17:07:10 PM
It simply means that I found the error and fixed it.

and no you do not need to use any commercial OPC. The error was just that vmError('my message') shows the error only to admin, vmError('my message','muh') shows to the admin "my message' and to anyone else 'muh'
Title: Re: Registering with existing username displays no error message
Post by: julos0877 on March 13, 2015, 12:03:38 PM
Great News.

Do you know by when it will be released?
Title: Re: Registering with existing username displays no error message
Post by: julos0877 on March 17, 2015, 10:20:07 AM
Hello Milbo,

Could you tell us which files we have to change by wating the new release?

Thanks in advance
Title: Re: Registering with existing username displays no error message
Post by: Milbo on March 18, 2015, 01:24:18 AM
http://dev.virtuemart.net/attachments/download/929/com_virtuemart.3.0.6.3_extract_first.zip
Title: Re: Registering with existing username displays no error message
Post by: julos0877 on March 18, 2015, 17:26:53 PM
Hello Milbo,

Just installed the new version and the problem is still there.
If I create an account with an username already used and I press the register button, the system comme back to the home shop page without error message.
Title: Re: Registering with existing username displays no error message
Post by: ReJigged on March 20, 2015, 01:41:25 AM
+1 on this.

Although slight difference in that if user tries to register again with same or existing username we see the page refresh and a message saying 'Please register to checkout' and customer ends up going in circles.

vm3.0.6.2

Will try 3.0.6.3 when stable release.
Title: Re: Registering with existing username displays no error message
Post by: Dudebaker on March 20, 2015, 10:31:45 AM
I've fixed it... with a dirty hack but hey... if the VM-Developers don't get it run... ;)

J2.5:

libraries\joomla\database\table\user.php [227-228]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_USERNAME_INUSE'));

libraries\joomla\database\table\user.php [241-242]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_EMAIL_INUSE'));


J3:

libraries\joomla\table\user.php [231-233]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_USERNAME_INUSE'));

libraries\joomla\table\user.php [247-259]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_EMAIL_INUSE'));



Edit:
added missing '
Title: Re: Registering with existing username displays no error message
Post by: ReJigged on March 20, 2015, 12:26:16 PM
Great work. Thanks!

Although you had a missing ' in the first J3 hack

Use:

J3:

libraries\joomla\table\user.php [231-233]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_USERNAME_INUSE'));

libraries\joomla\table\user.php [247-259]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_EMAIL_INUSE'));
Title: Re: Registering with existing username displays no error message
Post by: Dudebaker on March 20, 2015, 13:49:52 PM
I've now tried the latest version (J3.4, VM3.0.6.3) with a clear installation and it seems to be fixed (at least with the default template).
But all input-fields get cleared if there's an error.

At least in J2.5 VM2.6 the input-fields keep the values, even with my hack.
Title: Re: Registering with existing username displays no error message
Post by: julos0877 on March 21, 2015, 10:02:42 AM
Hello All,

Thank you to try to solve this problem.

This hack is working for the Register and checkout page but it does not work if the customer want to create an account before add to cart.
I we try to create an account by using the virtuemart menu "Account maintenance" (eq. http://demo.virtuemart.net/account) we have no error message if the email or username is already used we are redirected to the Shop home page..
Title: Re: Registering with existing username displays no error message
Post by: Milbo on March 22, 2015, 16:05:38 PM
lol

Quote from: Dudebaker on March 20, 2015, 10:31:45 AM
I've fixed it... with a dirty hack but hey... if the VM-Developers don't get it run... ;)

No, you just did obsolete stuff. Hacking joomla is the worst you can do. Additionally you guys do not tell which joomla version you are using.

It is also fixed already and if you want to understand how I fixed it, learn to use the provided tools, they are there to help you.

http://dev.virtuemart.net/projects/virtuemart/repository/diff/trunk/virtuemart/administrator/components/com_virtuemart/models/user.php?utf8=%E2%9C%93&rev=8777&rev_to=8754

that is the fix.
Title: Re: Registering with existing username displays no error message
Post by: Dudebaker on March 23, 2015, 08:19:22 AM
Quote from: Milbo on March 22, 2015, 16:05:38 PM
No, you just did obsolete stuff.

That's the reason for calling it dirty... sorry for my nasty words, but such a serious bug which hasn't been fixed since month if not years?

But you're right, I found this lines after trying the latest version but didn't post it.
So guy's change the user.php file from virtuemart/models instead of the user.php file from joomla/libraries.

administrator/components/com_virtuemart/models/user.php [666]
change:
vmError(vmText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED',$user->getError()));
to:
$msg = vmText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED',$user->getError());
vmError($msg,$msg);
Title: Re: Registering with existing username displays no error message
Post by: julos0877 on March 25, 2015, 13:50:08 PM
Up !

Modification is working fine for "Register and checkout" but it does not work for the creation of the new account. Test can be done here : http://demo.virtuemart.net/account
The customer has not to be oblige to buy something to create an account.

It becomes to be a critical issue ! If a customer want to create an account before buy something with an username already used and if he receives no error message during the registration, he will go away !
Title: Re: Registering with existing username displays no error message
Post by: Milbo on March 25, 2015, 13:54:43 PM
yepp Dudebaker, :-) The funny thing is, I felt in my own "security". vmError shows the info only to the administrator, to prevent that programmers reveal unintended sensitive data.

I must admit I dont understand, why it should not work with vm3.0.4 for the account maintenance, both uses the same model, the same function,...


Title: Re: Registering with existing username displays no error message
Post by: julos0877 on March 25, 2015, 14:08:46 PM
Hey Milbo,

I'm trying to create an account with the same username since the beginning but in fact no new account can be created with the simple registration page.
It works for the Register and Chekout but not for the account maintenance.

Maybe that can help you.
Title: Re: Registering with existing username displays no error message
Post by: julos0877 on April 20, 2015, 13:21:13 PM
Hallo Milbo,

Do you have a status about this topic. Now it's impossible to create a new account by using the virtuemart register form except for the register and checkout.
Did you give up ?

Thanks in advance
Title: Re: Registering with existing username displays no error message
Post by: Milbo on April 20, 2015, 18:37:57 PM
Quote from: julos08 on March 25, 2015, 14:08:46 PM
Hey Milbo,

I'm trying to create an account with the same username since the beginning but in fact no new account can be created with the simple registration page.
That is intended.

Quote from: julos08 on March 25, 2015, 14:08:46 PM
It works for the Register and Chekout but not for the account maintenance.

As guest it should "work", but you do not register then (check topic)