Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matt Taylor 808 posts 1878 karma points
    1 week ago
    Matt Taylor
    0

    Why is the stock property not enabled until after the product node is saved?

    In TC 3.2.5 when I add a new product node that contains the stock property it is initially disabled. I cannot enter a value into the stock property field.

    Disabled field

    If I save the node and then go back into it the stock property is enabled and a value can be entered.

    enter image description here

    This is not good as it introduces more click for the editor when creating content. I'm sure it never used to be like this in previous versions of TC.

  • Matt Brailsford 2114 posts 10380 karma points MVP 5x c-trib
    1 week ago
    Matt Brailsford
    100

    Hi Matt,

    How the stock property works is to store the stock value in a custom DB table. It does this in order to allow the stock value to change without needing to re-save the product node (saving Umbraco nodes results in various Umbraco things occurring including storing historic versions of your node in order to allow rollbacks). Unfortunately, in order for the stock property to know which node the stock property belongs to, it needs to wait until the node has been saved and thus now has an ID.

    It might have worked differently pre-v7, but that's because in previous versions of Umbraco the content node was created in the DB as soon as you clicked create from the content tree, and thus it had an ID. However in v7+, when you create a content node, it is not actually persisted until you hit save and so until then, the node doesn't have an ID the stock field can link to.

    I appreciate it's not the most optimum process though and I'll definitely see if there is anything that could be done to improve on this. It will likely only be addressed in the v8 version I'm working on though, but if I can, I'll try and back port it to v7 where possible.

  • Matt Taylor 808 posts 1878 karma points
    1 week ago
    Matt Taylor
    0

    Ok, thank you for the quick response Matt.

Please Sign in or register to post replies

Write your reply to:

Draft