Hello Tom,
thank you for that hint. It may work in the most cases. Unfortunately in my special field setup it didn't work. Anyways I've came up with another solution:
// Admin > Setup > Fields > Custom PHP code to find selectable pages
$categories = $pages->find('has_parent="/categories/", template="category"');
foreach ($categories as &$category) {
$breadcrumbs = wire('helper')->buildBreadcrumbList($category);
$category->title = join(' / ', $breadcrumbs);
}
return $categories;
Since I don't execute $category->save() that should be perfectly fine there and it seems to work like a charm without any side effects.