PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 2/11/2019 3:14 PM by  Will Strohl
Bug: Be careful when deleting product type property values
 5 Replies
 1 Subscribed to this topic
 1 Subscribed to this forum
Sort:
You are not authorized to post a reply.
Page 1 of 212 > >>
Author Messages





Basic Member






--
11/22/2018 6:34 AM
    Just a quick heads up:
    If you delete a product type property value make sure beforehand if this value is assigned to a product, otherwise you could run into problems:

    https://github.com/Hotcak...erce-core/issues/187





    Veteran Member






    --
    12/19/2018 3:22 PM
    Thanks for posting this! :)
    Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes





    Basic Member






    --
    2/8/2019 12:52 PM
    [b]DISCLAIMER:
    As Will correctly states below: Executing SQL Statements directly to the database will nullify any support or maintenance contract. Please contact your HCC Partner! [/b]

    The problem above affects Hotcakes Category Viewer when using DrillDown-View.
    It will stop working with a nasty error message

    If you run into this problem you can fix it using this the statement below:

    1) [b]Create a DB Backup[/b]
    2) Make sure DB Backup is correctly created
    3) Make sure you followed step 1) and 2)
    4) This is tested with HCC 3.1.0 on DNN 8.0.4

    [quote]
    SELECT ppv.id
    FROM hcc_ProductPropertyValue ppv
    LEFT JOIN hcc_ProductPropertyChoice ppc
    ON ppv.PropertyValue = ppc.Id
    WHERE ppv.PropertyId IN
    (
    SELECT ID
    FROM hcc_ProductProperty
    WHERE TypeCode = 2
    )
    AND ppc.Id IS NULL
    [/quote]

    if this returns one or more rows you can execute the following statement to delete the orphan references:

    [quote]
    DELETE FROM
    hcc_ProductPropertyValue
    WHERE id IN
    (
    SELECT ppv.id
    FROM hcc_ProductPropertyValue ppv
    LEFT JOIN hcc_ProductPropertyChoice ppc
    ON ppv.PropertyValue = ppc.Id
    WHERE ppv.PropertyId IN
    (
    SELECT ID
    FROM hcc_ProductProperty
    WHERE TypeCode = 2
    )
    AND ppc.Id IS NULL
    )
    [/quote]

    Now DrillDown View should work again.
    Hope that helps.
    Reto





    Veteran Member






    --
    2/8/2019 3:47 PM
    So... Should we trust your SQL snippet, or not? :D

    For all: Just so you know, I realize that everyone tends to run SQL against various solutions out there. It's always worth noting, though, that it's rare that any solution supports any kind of direct SQL access and in most cases running SQL is nullify any support or maintenance contract you might have. :)
    Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes





    Basic Member






    --
    2/11/2019 2:36 AM
    Hi Will

    You are correct, I updated my post above to make aware of the problem with executing SQL statements against the db but left the statements in there.
    If you think they should be removed (not sure about that) please PM
    You are not authorized to post a reply.
    Page 1 of 212 > >>


    Loading
    • Sign-up for the Hotcakes Community Newsletter: