fix: preload white paper titles to avoid UUID recursive resolution
All checks were successful
Deploy Production / Deploy to Production (push) Successful in 21s

kirby()->page($uuid) triggers a full site tree scan which can fail
depending on server config. Instead, load livres-blancs children once
and build a uuid→title map for O(1) lookups in the contact loop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-06-01 17:40:52 +02:00
parent 5ae8dd0d17
commit e97a3501ed

View file

@ -21,6 +21,13 @@ Kirby::plugin('world-game/csv-export', [
exit;
}
// Pré-charger les titres des livres blancs par UUID
// (évite la résolution UUID récursive dans la boucle)
$wpTitles = [];
foreach ($livresBlancs->children() as $wp) {
$wpTitles[$wp->uuid()->toString()] = $wp->title()->value();
}
$entries = $livresBlancs->contactDatabase()->toStructure();
header('Content-Type: text/csv; charset=UTF-8');
@ -39,9 +46,8 @@ Kirby::plugin('world-game/csv-export', [
$titles = [];
foreach ($uuids as $uuid) {
$wp = kirby()->page($uuid);
if ($wp) {
$titles[] = $wp->title()->value();
if (isset($wpTitles[$uuid])) {
$titles[] = $wpTitles[$uuid];
}
}