Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 14 of 14

Thread: V9 Product Name Length Issue "Product could not be found"

  1. #1
    natt_a is offline Junior Member
    Join Date
    Nov 2009
    Posts
    11

    Default V9 Product Name Length Issue "Product could not be found"

    Sometimes I run into issue where the product name is too long, when I test it I will get Product Could not be found page after clicking on it from category page.

    I wish there is some sort of character count, or a limit set for Product Name input where I could not type in any more character into the input field. It would also be nice if the name input field is bigger/longer.

    Or is there an easy way to increase the character limit for Product Name?

    Thank you.

  2. #2
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    The "Name" field in the product table has enough length (nvarchar(400)) already to cater long product names. I wonder how much long does your product names have?

  3. #3
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Or is there an easy way to increase the character limit for Product Name?
    Just open up sql management studio, connect to the database, and change the Name field to nvarchar(MAX)
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  4. #4
    doru is offline Senior Member
    Join Date
    Jan 2008
    Posts
    158

    Default

    Hi

    I have the same problem with the following name - "Full Function Control Head Only, Weather Resistant, with a 7-1/2' Cable, for Handlebar and Surface Mounting (Motorcycle)".

    The product name is working properly on admin side. But, on the public side, I open the category page and then I click on that product name. Then I got the t-productnotfound.aspx page. When I rename the product with a short name, then I can open the product detail page on public side.

    I need to know what I have to do in order to use the following product name ""Full Function Control Head Only, Weather Resistant, with a 7-1/2' Cable, for Handlebar and Surface Mounting (Motorcycle)"

    Any help would you greatly appreciated!

    Thank you,
    Doru

  5. #5
    deanfp is offline Senior Member
    Join Date
    May 2009
    Location
    Sweden
    Posts
    556

    Default

    Just out of interest try removing the ' and see what happens.

    Doubt it will make a difference but it did cause problems for me on V7.

  6. #6
    doru is offline Senior Member
    Join Date
    Jan 2008
    Posts
    158

    Default

    I've removed the ' but I have the same issue.
    I'm using ASPDSNF V9

    Doru

  7. #7
    jasonhendee is offline Junior Member
    Join Date
    Dec 2010
    Posts
    1

    Default

    It's not the length of your product name that's causing the problem - the application will allow up to 150 characters to be used in the product name field, since that is the length of the SEName field in the Product table. The problem is the number of non-text (or numeric) character series that are present. I ran into this same problem today with the following product name:

    Vutec 120 inch EconoPro T-Series Diagonal Portable Tripod Screen - 72 inch X 96 inch Viewing Area

    My product name has 16 spaces or other non-text/numeric character series (i.e. " - ") that are replaced with hyphens when entered into the SEName field of the Product table. I did some testing, and found that I can reproduce this same problem with the following product name:

    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

    Notice how the above example name is only 37 characters long, but has 15 spaces that are replaced with hyphens when inserted into the SEName field of the Product table. BUT if I use the following example name instead, it works:

    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

    The product is displayed instead of the product not found topic. Because there are now only 14 spaces replaced with hyphens. So it seems that somewhere along the way, the application has trouble with more than 14 hyphens in the SEName field when it tries to pull up a given product.

    I haven't found the source of the problem yet, but wanted to throw this theory out there in case someone else can run with it and find the solution faster than I can. I guess I would rather fix the problem than make sure that none of my products have more than X number of resulting hyphens...

  8. #8
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    That's correct, product names with more than 15 'segments' will result in a 404. The new routing rules in v9 require that we have some kind of limit in there, and that's just what it was set to previously.

    In 9.1.0.0, which was released yesterday if you missed it, we upped that limit to 30.

  9. #9
    doru is offline Senior Member
    Join Date
    Jan 2008
    Posts
    158

    Default

    Thank you for help!

    Doru Pirvu

  10. #10
    CreepyJeeper is offline Junior Member
    Join Date
    Nov 2011
    Posts
    2

    Default

    Is there any way to increase that number from 30? The biggest I found on my products with a rough check was 50. Or is there a way to have the url truncate to the desired size with out having the title changed?

  11. #11
    bwarrior is offline Junior Member
    Join Date
    Mar 2013
    Posts
    15

    Default

    I know I'm reopening an old post but it seems this is still an issue 2 years later...

    I have the latest version of ASPDNSF and I get an error when I try to add a product with more than 151 characters. I have less than 30 spaces/special characters and the database supports up to 400 characters for product name. Yet I get the error:

    String or binary data would be truncated.
    The statement has been terminated.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: String or binary data would be truncated.
    The statement has been terminated.

  12. #12
    bwarrior is offline Junior Member
    Join Date
    Mar 2013
    Posts
    15

    Default

    As a workaround, I can add up to 400 characters directly in the database. Unfortunately, that adds a lot more manual work for me. It seems easy enough that the add/edit product form would be intelligent enough to do what it wants with the SEName (shorten it) and still allow anyone to have a product name up to 400 characters. Just makes good sense... Am I missing something?

    **UPDATE**

    IF you add more than 151 characters directly to the database, you WILL NOT be able to edit your product, UNLESS you shorten it.

    Should this be considered a BUG? Certainly, I should be able to enter a longer product name.
    Last edited by bwarrior; 08-19-2013 at 01:27 PM.

  13. #13
    mmcgeachy is offline Senior Member
    Join Date
    Sep 2008
    Posts
    174

    Default

    Looking at the original source code it looks like the import process doesn't have a truncation issue. The edit product does have the truncation issue however. It would be a small modification to make entityEditProducts.aspx work like the import process. Which is editing entityEditProducts.aspx.cs in two places the insert statement and the update statement.
    insert statment change:

    Code:
    sql.Append(DB.SQuote(CommonLogic.Left(SE.MungeName(AppLogic.GetFormsDefaultLocale("Name", txtName.Text, locale, "Product", pID)), 150)) + ",");
    The update statement:
    Code:
    sql.Append("SEName=" + DB.SQuote(CommonLogic.Left(SE.MungeName(AppLogic.GetFormsDefaultLocale("Name", txtName.Text, locale, "Product", pID)), 150)) + ",");
    However with names being that long instead of using auto generated sename, I would add a text box for the sename and only use a auto generated sename when the sename text box is left blank. Which mostly adding some additional !string.IsNullOrEmpty if statements.

    Hope that helps
    Last edited by mmcgeachy; 08-19-2013 at 02:23 PM. Reason: code tag wasn't split up

  14. #14
    bwarrior is offline Junior Member
    Join Date
    Mar 2013
    Posts
    15

    Default

    YES! It looks like that works perfectly! Thank you!

    sure enough, it's the SEName column that causes the problem
    max length is 150 chars
    Last edited by bwarrior; 08-20-2013 at 08:28 AM.