logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne2  
#1 Posted : Friday, January 14, 2022 9:29:00 AM(UTC)
Joe Payne2

Rank: Advanced Member

Groups: HelpDesk, Developers
Joined: 11/9/2018(UTC)
Posts: 564

Thanks: 122 times
Was thanked: 26 time(s) in 25 post(s)
I found these bugs first in Able Gold and later confirmed in v9.

Steps to reproduce:

Create a user
Place 1 order for the user, shopper side or admin it doesn't matter
Now delete the user you just created

Bug #1:
Pull up the order in order manager. Customer profile tab still renders. This shouldn't render since the user associated to the order no longer exists. Clicking it throws an exception.

Bug #2:
Click the move order button at the bottom. Console shows a 500 error. Move order UI never renders.

Bug #3:
Even if you could pull up the Move-order dialog, the orderRepo.UpdateUser() routine will fail to move the order to the selected user. The reason is the routine is written assuming the oldUserId on the existing order will be 0. But SQL cascade-update set the UserId to null on the order object when the user was deleted, not 0. So all of those ugly manual SQL queries that have a 'WHERE UserId = :oldUserId' will fail to find the order involved. They have to all be modified to 'WHERE UserId IS NULL'. In fact, specifying the old user id isn't even necessary when updating the order object. It can only ever have 1 user associated to it anyways so there's no point in making it part of the where clause.

However this poses a problem once you get to updating user groups and subscriptions as the overall SQL schema is not consistently designed. Some tables get a cascade-update that set UserId to null, others like user groups appears to simply cascade-delete the entire child data object.

This feature needs some serious love to be stable. And those hard-coded SQL update queries deviate from accepted nHibernate implementation practice. Somebody got lazy.

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shaharyar  
#2 Posted : Friday, January 14, 2022 12:04:19 PM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 703

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Thanks for pointing this out.

I am registering this as a bug.
Regards
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.