fix: preload white paper titles to avoid UUID recursive resolution
All checks were successful
Deploy Production / Deploy to Production (push) Successful in 21s
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:
parent
5ae8dd0d17
commit
e97a3501ed
1 changed files with 9 additions and 3 deletions
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue