Anyone else run into the issue when they have too many items in a category, and the OrderBy field gets populated with -32768 repeatedly. This is the lower bound of the SmallInt (short) datatype.
On one hand, I'd like to have "real" values in the orderby field.
OTOH, if it's not going to cause problems for the orderby values to all be identical for items that don't need explicit sorting, I don't want to mess with the DB design and C# variable types.
Anyone with more experience care to comment or offer guidance?
Thanks,
Crockett
CatalogNodes.OrderBy type "short" too short
- crockettdunn
- Lieutenant Commander (LCDR)
- Posts: 105
- Joined: Sun Oct 26, 2008 6:32 pm
- Contact:
- ForumsAdmin
- AbleCommerce Moderator
- Posts: 399
- Joined: Wed Mar 13, 2013 7:19 am
Re: CatalogNodes.OrderBy type "short" too short
Although this issue hasn't come up often we do have an enhancement bug registered in our database about updating the 'short' type fields to 'int'. There are two such locations where limit of 'short' datatype can be reached. One is the orderby field as you have mentioned. It can happen if a category has more than 32,767 nodes. The workround for this is to sub-categorize such a huge category. The other field is the quantity field. It is very rare for the quantity field to exceed 32,767, but special situations can always occur. We are considering to update these fields to 'int' in future.
Re: CatalogNodes.OrderBy type "short" too short
The bigger issue is not quantity data being persisted, it's the quantity data in reports. Without type conversion, the developer is forced to use shorts for report totals of quantity, which can (and does) easily exceed the max value.ForumsAdmin wrote:It is very rare for the quantity field to exceed 32,767, but special situations can always occur.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
- ForumsAdmin
- AbleCommerce Moderator
- Posts: 399
- Joined: Wed Mar 13, 2013 7:19 am
Re: CatalogNodes.OrderBy type "short" too short
A bug has been loged to increase the size of 'short' fields to 'int'. What is preventing us from getting this done straight away is the amount of changes it will require throughout the code base. We are trying to access the best course of action.
- crockettdunn
- Lieutenant Commander (LCDR)
- Posts: 105
- Joined: Sun Oct 26, 2008 6:32 pm
- Contact: