Closed stephenfrank closed 3 years ago
Thanks for bringing this up and providing a possible fix. We'll talk this over internally and figure if this is something that Craft should be doing (updating elements that are being moved) or should we proceed with your proposed fix.
Sorry for taking the scenic route on this one! I implemented your fix in the Gatsby Helper plugin and that will be a part of the next release.
Reference: craftcms/gatsby-helper@9b32c819ab80c03873f28acd9608b0b56c996fc4
Description
I have a structure section used to create a sidebar and page hierarchy. The sidebar hierarchy doesn't update or gets out of order when moving nodes and doing incremental builds.
I've determined that moving a structure item does not update the Element's
dateUpdated
so it is not picked up in thenodesUpdatedSince
list.This is compounded by the fact that if I then edit one of the structure entries, only the edited entry will feed through to
nodesUpdatedSince
and I end up with invalidlft
/rgt
values in the structure in the Gatsby internal storage.Here's my solution that I've used to get around this issue... you may have a different take on the issue or a different direction to take it so it's just here for reference:
https://github.com/flowsa/gatsby-helper/commit/93e94250b529a07f7082a67bf81d151ccbea8b69