Commit 4bc28278 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix PDF export to render steps for all tutorial sections

collectBookData() was only extracting steps for 3 hardcoded sections
(membership, sports-activity, treasury) using regex on view files.
All other sections (45 of 48) were passed without steps, rendering
only subtitle text in the PDF. Now calls TutorialRegistry::getSteps()
for every tutorial in every section.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 3561cc77
......@@ -618,6 +618,9 @@ class TutorialController extends Controller
$raw = file_get_contents($viewFile);
$extracted = $this->extractTutorialSteps($raw);
}
if (empty($extracted['steps'])) {
$extracted['steps'] = TutorialRegistry::getSteps($key, $slug);
}
$tutorials[$slug] = array_merge($tutorial, [
'steps' => $extracted['steps'],
'images' => $extracted['images'],
......@@ -650,6 +653,10 @@ class TutorialController extends Controller
}
}
}
foreach ($tutorials as $slug => &$tutorial) {
$tutorial['steps'] = TutorialRegistry::getSteps($sectionKey, $slug);
}
unset($tutorial);
$book['sections'][$sectionKey] = [
'title' => $sectionMeta['title'],
'subtitle' => $sectionMeta['subtitle'] ?? '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment