bnomei / kirby3-autoid

Automatic unique ID for Pages, Files and Structures including performant helpers to retrieve them. Bonus: Tiny-URL.

Home Page:https://forum.getkirby.com/t/kirby3-autoid-plugin/23572

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

modified-helper does not notice change in count

bnomei opened this issue · comments

when caching a collection like $page->children() only existing objects are tracked.

this creates two bugs.

  • one when an objects is removed (easy to fix, will do)
  • another when an objects was added to the collection (no idea yet)

a expire timer could semi-solve the issue with adding objects. cache will then work well for short repeated calls but not longterm. please upvote if you like this.

if object in collection was removed the helper will not notice that and return null.

foreach($collection as $p) {
   if($p == null) continue; // avoid crashing like this
   // ... do stuff
}