Permalinks - Update tables using cron
I have set up a crawler to import product listings from various websites on a daily basis. I would like to have CMSB auto generate the permalinks for the products. Is it possible to somehow get the Permalinks plugin to run via cron so my product listings table has any missing permalinks generated every hour?
Or is there a better way to do this?
Thanks for any help or advice!
Further to my previous post, we have modified the crawler to create the permalink so don't need to run the permalink plugin anymore.
So now the products are being imported with a permalink value however when I view the product page at the front end I receive a 404 error.
To resolve this I just need to go into CMSB, edit the product and simply click "save" (without making any changes to any of the fields) and then the product loads correctly at the front end (no more 404!).
I have compared the product row in the database before and after saving the listing and the fields are identical so I don't know why the product suddenly loads after saving the record in CMSB.
I would be extremely grateful if someone could explain to me what's going on here.
Problem identified! We need the crawler to update the permalinks table too. Manually running the permalinks plugin doesn't do this (I guess because the crawler has already created the permalinks).
Maybe we should just have the permalinks plugin run via cron every 5 minutes and not have the crawler create the permalinks...
Is it possible to configure the permalinks plugin to update a specific table on cron?
The constant is defined in init.php, so this should fix those errors/warnings.
<?php require_once 'cmsb/lib/init.php'; require_once 'cmsb/lib/schema_functions.php'; require_once 'cmsb/lib/mysql_functions.php'; require_once 'cmsb/lib/database_functions.php'; require_once 'cmsb/plugins/permalinks/permalinks_pluginsMenu.php'; $response = _permalink_updateTable('listings');