Author Topic: Registering with existing username displays no error message  (Read 8093 times)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10213
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

julos08

  • Beginner
  • *
  • Posts: 34
Re: Registering with existing username displays no error message
« Reply #16 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.

ReJigged

  • Jr. Member
  • **
  • Posts: 82
Re: Registering with existing username displays no error message
« Reply #17 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.

Dudebaker

  • Beginner
  • *
  • Posts: 10
Re: Registering with existing username displays no error message
« Reply #18 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 '

ReJigged

  • Jr. Member
  • **
  • Posts: 82
Re: Registering with existing username displays no error message
« Reply #19 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'));

Dudebaker

  • Beginner
  • *
  • Posts: 10
Re: Registering with existing username displays no error message
« Reply #20 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.

julos08

  • Beginner
  • *
  • Posts: 34
Re: Registering with existing username displays no error message
« Reply #21 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..

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10213
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Registering with existing username displays no error message
« Reply #22 on: March 22, 2015, 16:05:38 pm »
lol

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Dudebaker

  • Beginner
  • *
  • Posts: 10
Re: Registering with existing username displays no error message
« Reply #23 on: March 23, 2015, 08:19:22 am »
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);

julos08

  • Beginner
  • *
  • Posts: 34
Re: Registering with existing username displays no error message
« Reply #24 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 !

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10213
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Registering with existing username displays no error message
« Reply #25 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,...


Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

julos08

  • Beginner
  • *
  • Posts: 34
Re: Registering with existing username displays no error message
« Reply #26 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.

julos08

  • Beginner
  • *
  • Posts: 34
Re: Registering with existing username displays no error message
« Reply #27 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

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10213
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Registering with existing username displays no error message
« Reply #28 on: April 20, 2015, 18:37:57 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.

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)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/