Function db_next_id() isn't available in Drupal 6 ... it is available for D5 and D7 but unfortunately not for D6...
I just installed your module (very useful IMO, I think this should go to UC core!) and found this by code review. It doesn't cause to me some error until now. I suggest to use db_last_insert_id() instead.
/*
* Sets the automatically generated SKU for the node
*/
function uc_product_power_tools_sku_set($pattern, &$node) {
if (trim($pattern)) {
// ... some code ...
// around line 220
else {
$temp = db_next_id('{node}_nid');
$node->model = t('@type', array('@type' => $node->type, '@node-id' => $temp));
}
// ... etc ...
}
Comments
Comment #1
willvincent commentedI don't know that that will work..
db_last_insert_id() returns the last in insert into a specified table & field, but if memory serves, this variable has to exist before the record is insert into the database so that it is able to be updated immediately after initial insertion with the desired auto-sku pattern.
The code that does this is pretty much the same as the code used in the auto-node-title module. I'll take a look at it though, unless you want to write a patch to fix this :)
Comment #2
willvincent commentedComment #3
willvincent commentedComment #4
willvincent commentedChanged in version 6.x-1.12
Comment #5
willvincent commented