Open kgevaert opened 3 years ago
Have you made sure the IDs have actually been assigned? You can simply check in the panel by removing type: hidden
. If not, you might want to re-index.
@jonasfeige The IDs are correctly assigned. Tested by removing type:hidden
and you see it in site.txt.
Does it work for you?
since i am on parental leave right now i sadly do not have the time to debug this on my own. please try asking this in the forum.
my suspicion would be that the filterBy function tries calling whatever string is in the first parameter and it works for only if that results in a structure object. but i am not sure why it should fail for autoid
.
the plugin registers a global helper and page method with that name but it does not extend the structure class.
I can confirm that filterBy()
does not seem to be working any longer with autoid
. As a temporary workaround, you can use filter()
. Just tested and it seems to work as expected:
$categories = site()->categories()->toStructure()->filter(function($category) {
return $category->autoid() == '58lfd99u';
});
blueprint
site.txt
The following code doesn't seem to work anymore on kirby 3.5. I use the latest autoid-plugin.
$categories= site()->categories()->toStructure()->filterBy('autoid','58lfd99u');
echo count($categories) gives 0;But following code works on the 'cat_title'
$categories= site()->categories()->toStructure()->filterBy('cat_title','new');
echo count($categories) gives 1;