Git Product home page Git Product logo

Comments (1)

CMeeg avatar CMeeg commented on June 16, 2024

Thanks for raising this @jonathantwite :)

TL;DR - Please install v0.3.1 of the NuGet packages and your issue should hopefully be resolved!

Setting the NodeParentID when persisting the component data was originally done to support adding "Pages" fields to components because the relationships need to reference the component's "parent" node rather than the component itself. NodeParentID is an existing property on TreeNode so it was convenient to use that rather than adding more of my own code, but I hadn't thought about this scenario!

I thought of a few ways to tackle it:

  1. Don't persist the NodeParentID and just set it when instantiating the component at runtime
  2. Use a custom field to store a guid reference to the "parent" or some other reference that will persist between CI runs (as you have suggested)
  3. Try to hook into the relevant CI operations and "translate" the NodeParentID to the appropriate value when CI is executed

I decided against option 2 because it doesn't feel like I should have to add additional fields to get the "parent" when there are already existing properties for doing that - I'm not dead set against this, but it just didn't "feel" right.

I went for option 1 in the end though there is a slight cost to this if you use nested components (i.e. components that themselves have components) as the code will walk up the tree until it finds the first "parent" that isn't a component. For "top-level" components though (the most common scenario from what I can gather of people using this module) the component is resolved in the context of the "parent" so setting the reference at runtime is a straight-forward assignment.

I have also raised issue #8 to investigate option 3 as that feels like a "better" option though a) there is a blocker in me investigating that due to not having a CI-enabled license for this project; and b) it felt like potentially a lot of effort for not much additional value (at this point at least)!

v0.3.1 of the packages have been released to NuGet with the changes to support option 2 - hopefully this will resolve your issue :)

from kentico-contrib.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.