{"record":{"id":"af0444207b0d68ba","repo":"octobercms/october","slug":"section-handle-handle-not-found","errorCode":null,"errorMessage":"Section handle [{$handle}] not found","messagePattern":"Section handle \\[(.+?)\\] not found","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/tailor/models/EntryRecord.php","lineNumber":218,"sourceCode":"        $this->setPublishingDates($this->published_at ?: $this->freshTimestamp());\n    }\n\n    /**\n     * setPublishingDates\n     */\n    protected function setPublishingDates($useDate)\n    {\n        $this->published_at_date = $useDate;\n    }\n\n    /**\n     * inSection\n     */\n    public static function inSection($handle)\n    {\n        $blueprint = BlueprintIndexer::instance()->findSectionByHandle($handle);\n        if (!$blueprint) {\n            throw new SystemException(\"Section handle [{$handle}] not found\");\n        }\n\n        $model = $blueprint->newModelInstance();\n\n        return $model::inSectionUuid($blueprint->uuid);\n    }\n\n    /**\n     * inSectionUuid\n     */\n    public static function inSectionUuid($uuid)\n    {\n        $instance = new static;\n\n        $instance->extendWithBlueprint($uuid);\n\n        return $instance;\n    }","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/tailor/models/EntryRecord.php#L200-L236","documentation":"Thrown by EntryRecord::inSection($handle) when the BlueprintIndexer cannot resolve the given section handle to a blueprint. The indexer maintains a registry of blueprints defined in tailoring files/blueprints; if no section blueprint matches the handle, a SystemException is raised before any query is built.","triggerScenarios":"Calling EntryRecord::inSection('handle') with a handle that does not match any section blueprint: typo, wrong case (handles are case-sensitive), referencing a blueprint that has not been created yet, or calling before Tailor has indexed the blueprints.","commonSituations":"Hardcoding a handle in theme code or a component that drifts out of sync with renamed blueprints; blueprints not synced after pulling code (tailor migrations are DB-stored); environment differences where the blueprint file exists in one environment but not another; handle renamed in YAML but old handle still used in page code.","solutions":["Confirm the exact handle in the blueprint YAML (the handle: property of the section) and use it verbatim in inSection()","Run php artisan tailor:sync (and php artisan cache:clear) so the blueprint indexer picks up newly added or changed blueprints","If the blueprint was renamed, update every call site (pages, components, partials) to the new handle","Check for case mismatches: handles like Blog vs blog are not interchangeable"],"exampleFix":"// before\n$records = \\Tailor\\Models\\EntryRecord::inSection('BlogPost')->get();  // handle is blog_post\n\n// after\n$records = \\Tailor\\Models\\EntryRecord::inSection('blog_post')->get();","handlingStrategy":"validation","validationCode":"// Resolve the handle safely before querying\n$blueprint = \\Tailor\\Classes\\BlueprintIndexer::instance()->findSectionByHandle($handle);\nif (!$blueprint) {\n    // fallback: log, return empty collection, or use a default section\n    return collect();\n}\n$records = \\Tailor\\Models\\EntryRecord::inSectionUuid($blueprint->uuid)->get();","typeGuard":"function sectionHandleExists(string $handle): bool\n{\n    return \\Tailor\\Classes\\BlueprintIndexer::instance()->findSectionByHandle($handle) !== null;\n}","tryCatchPattern":null,"preventionTips":["Run php artisan tailor:sync as part of every deployment pipeline","Centralize section handles as constants or a config map instead of scattering string literals through templates","After renaming a blueprint handle, grep the whole codebase for the old handle before deploying"],"tags":["tailor","octobercms","blueprint","section","handle","indexer"],"backgroundTag":"handle-not-found","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}