SmarThuis Posted May 9, 2024 Share Posted May 9, 2024 Uncaught PHP Exception InvalidArgumentException: "Invalid category parameter" at /home/smarthuis/domains/smarthuis.nl/public_html/classes/Link.php line 448 When I try to generate a SiteMap InvalidArgumentException: Invalid category parameter at classes/Link.php:448 at LinkCore->getCategoryLink() (modules/gsitemap/gsitemap.php:537) at Gsitemap->getCategoryLink() (modules/gsitemap/gsitemap.php:755) at Gsitemap->createSitemap() (modules/gsitemap/gsitemap.php:208) at Gsitemap->getContent() (controllers/admin/AdminModulesController.php:696) at AdminModulesControllerCore->postProcessCallback() (controllers/admin/AdminModulesController.php:921) at AdminModulesControllerCore->postProcess() (classes/controller/Controller.php:308) at ControllerCore->run() (classes/Dispatcher.php:510) at DispatcherCore->dispatch() (admin187eh0u242qqbazbsdy/index.php:95) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted May 10, 2024 Share Posted May 10, 2024 (edited) Please indicate versions of PS, PHP and gsitemap module. Edited May 10, 2024 by Prestashop Addict (see edit history) Link to comment Share on other sites More sharing options...
compsoul.dev Posted November 5 Share Posted November 5 It’s very likely your category has no language row in ps_category_lang for the language you’re generating, so the module’s getCategoryLink() ends up working with an unloaded Category and still tries to read its properties. The weak guard is inside the module’s getCategoryLink() (the sitemap method). You can pinpoint the offending record with a quick dump: // inside modules/gsitemap/... getCategoryLink() dump($category_id); $category = new Category((int) $category_id['id_category'], (int) $lang['id_lang']); if (empty($category->id_category)) { dump($category); die; } The loop will stop on the problematic category when you try to generate the sitemap, meaning that this category is missing its language entry (or isn’t properly loaded). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now