{"record":{"id":"f3569b75ca17ca1b","repo":"aimeos/aimeos-laravel","slug":"abort-404","errorCode":null,"errorMessage":"abort( 404 );","messagePattern":"abort\\( 404 \\);","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"src/Controller/PageController.php","lineNumber":38,"sourceCode":"class PageController extends Controller\n{\n\t/**\n\t * Returns the html for the content pages.\n\t *\n\t * @return \\Psr\\Http\\Message\\ResponseInterface Response object containing the generated output\n\t */\n\tpublic function indexAction()\n\t{\n\t\t$params = ['page' => 'page-index'];\n\n\t\tforeach( app( 'config' )->get( 'shop.page.cms', ['cms/page', 'catalog/tree', 'basket/mini'] ) as $name )\n\t\t{\n\t\t\t$params['aiheader'][$name] = Shop::get( $name )->header();\n\t\t\t$params['aibody'][$name] = Shop::get( $name )->body();\n\t\t}\n\n\t\tif( empty( $params['aibody']['cms/page'] ) ) {\n\t\t\tabort( 404 );\n\t\t}\n\n\t\treturn Response::view( Shop::template( 'page.index' ), $params )\n\t\t\t->header( 'Cache-Control', 'private, max-age=10' );\n\t}\n}\n","sourceCodeStart":20,"sourceCodeEnd":45,"githubUrl":"https://github.com/aimeos/aimeos-laravel/blob/9879c60332e9fc6611450be9879f5eb1a93c887c/src/Controller/PageController.php#L20-L45","documentation":"The Aimeos PageController::indexAction() renders the CMS content page and aborts the request with a Laravel HTTP 404 when the rendered 'cms/page' client body is empty. This means no CMS page content could be produced for the request — typically because no CMS page exists for the current URL/label in the database, or the cms/page client intentionally output nothing. The library throws it to turn 'missing content' into a proper not-found response instead of rendering an empty page.","triggerScenarios":"The 'cms/page' entry in config shop.page.cms is requested but Shop::get('cms/page')->body() returns an empty string, which happens when the CMS page (tree item / slug) for the current request does not exist in the mshop_cms tables, the page is disabled, or the site/locale context has no matching CMS record.","commonSituations":"Visiting a CMS URL slug that was never created or was deleted/unpublished; running with a fresh or incomplete database where CMS content was never imported; multi-site setups where the content exists in another site but not the current one; misconfigured 'shop.page.cms' including 'cms/page' when the CMS component isn't set up.","solutions":["Create/publish the CMS page for the requested slug in the Aimeos admin (or import CMS content) so the cms/page client renders a body","Verify the requested URL slug matches an existing CMS page record in the database for the current site","Check config shop.page.cms: if you don't use CMS functionality, remove 'cms/page' from the list or ensure the cms frontend controller/provider is available","Clear caches (Aimeos cache, Laravel view/config cache) after adding the content, then retry the URL"],"exampleFix":"// before: URL /help returns 404 because no CMS page exists\n// after: create the page in admin or seed it, then verify\nphp artisan aimeos:cache --clear\n// ensure a cms item with URL segment 'help' exists for the current site, e.g. via admin UI -> Page -> Add 'help'","handlingStrategy":"try-catch","validationCode":"// Check before linking/rendering that the CMS page exists\n$page = \\Aimeos\\Controller\\Frontend::create( app('aimeos.context')->get(), 'cms' )->find( $slug );\nif( $page === null ) { // slug not available, don't render the link\n}","typeGuard":"function cmsBodyExists( array $aibody, string $key = 'cms/page' ): bool {\n    return isset( $aibody[$key] ) && is_string( $aibody[$key] ) && $aibody[$key] !== '';\n}","tryCatchPattern":"try {\n    $response = \\Aimeos\\Shop\\Facades\\Shop::get('page.index')->body(); // or your route call\n} catch( \\Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException $e ) {\n    return response()->view('errors.cms-missing', ['slug' => $slug], 404);\n}","preventionTips":["Seed CMS pages for every slug your templates/links reference","Keep 'shop.page.cms' config in sync with installed Aimeos components","After content changes, clear Aimeos and Laravel caches","Monitor 404s on CMS routes to catch deleted/unpublished pages"],"tags":["http-404","laravel","cms","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"9879c60332e9fc6611450be9879f5eb1a93c887c","analyzedAt":"2026-09-12T15:16:33.901Z","contentChangedAt":"2026-09-12T15:16:33.901Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}