When the order is updated as completed, error:
user warning: Unknown column 'type' in 'field list' query: SELECT `type` FROM `uc_node_checkout_types` WHERE `type`='rek' ORDER BY `product_nid` DESC LIMIT 1; in /home/ff/domains/ff/public_html/ff/sites/all/modules/uc_node_published/uc_node_published.module on line 16.

using
UberCart 6.x-2.0-beta4
Node Checkout 6.x-2.0-beta3

CommentFileSizeAuthor
#1 375005.1.patch1.97 KBnicksanta

Comments

nicksanta’s picture

Status: Active » Needs review
StatusFileSize
new1.97 KB

I couldnt replicate the issue, but decided to change some possibly buggy code which may be the cause of the problem.

give this patch a try, i've changed custom queries to a uc_node_checkout api function

vildoc’s picture

bad patch
on 7 line

nicksanta’s picture

sorry, that was my first attempt at creating a patch.
this one is tested.

nicksanta’s picture

Sorry, i can't upload the file.. must be something to do with the upgrade. here is the file

--- uc_node_published.module	2009-02-16 10:38:28.000000000 +1100
+++ uc_node_published.module	2009-02-18 22:44:14.000000000 +1100
@@ -13,8 +13,8 @@ function uc_node_published_order($op, &$
       foreach ($arg1->products as $item) {
         $node = node_load($item->data['node_checkout_nid']);
         // make sure we only affect uc_node_checkout related items
-        $uc_node_type = db_result(db_query("SELECT `type` FROM `uc_node_checkout_types` WHERE `type`='$node->type' ORDER BY `product_nid` DESC LIMIT 1;"));
-        if ($uc_node_type) {
+        $types = array_keys(uc_node_checkout_product_map());
+        if (in_array($node->type, $types)) {
           if ($output) { $output .= ', '; }
           $output .= '<strong>'. l($node->title, 'node/'. $node->nid) .'</strong>';
           $type = 'node checkout';
@@ -31,8 +31,8 @@ function uc_node_published_order($op, &$
         foreach ($arg1->products as $item) {
           $node = node_load($item->data['node_checkout_nid']);
           // make sure we only affect uc_node_checkout related items
-          $uc_node_type = db_result(db_query("SELECT `type` FROM `uc_node_checkout_types` WHERE `type`='$node->type' ORDER BY `product_nid` DESC LIMIT 1;"));
-          if ($uc_node_type) {
+          $types = array_keys(uc_node_checkout_product_map());
+          if (in_array($node->type, $types)) {
             if ($output) { $output .= ', '; }
             $output .= '<strong>'. l($node->title, 'node/'. $node->nid) .'</strong>';
             $type = 'node checkout';
@@ -49,8 +49,8 @@ function uc_node_published_order($op, &$
   case 'delete':
     foreach($arg1->products as $item) {
       $node = node_load($item->data['node_checkout_nid']);
-      $uc_node_type = db_result(db_query("SELECT `type` FROM `uc_node_checkout_types` WHERE `type`='$node->type' ORDER BY `product_nid` DESC LIMIT 1;"));
-      if ($uc_node_type) {
+      $types = array_keys(uc_node_checkout_product_map());
+      if (in_array($node->type, $types)) {
         node_delete($node->nid);
       }
     }
vildoc’s picture

fanks

yingtho’s picture

Status: Needs review » Reviewed & tested by the community

I have testede it and it worked as it should.

yymoto2’s picture

Hi,

This is my first time trying to apply a patch, but I fail to do so. I'm using eclipse PDT2.0 on Windows XP, copied the patch code in comment #4 and patch it to 'uc_node_published' folder, but it returns following message:

uc_node_published.module 2009-02-16 10:38 (file does not exist)
|-- 12,8 -> 12,8
|-- 30,8 -> 30,8
|-- 48,8 -> 48,8

May I know where i did wrong? Can anybody advice? Thanks.

yymoto2’s picture

Hi,

I somehow manage to patch the file and start using it.
Everything works find until the very last page "Order Complete" page. Message displayed as intended also:

* Order 1 has been been marked as completed.
* Title marked as published

Although the message stated so, when I check back the actual 'Publish/unpublish status' for the respective node, it still remained at the 'unpublish' state. May I know where went wrong? Please advice. Thanks.

ck9’s picture

Same problem here, I get an error about the 'type' field and the node is not published after checkout.

nicksanta’s picture

Hi guys, sorry about the complete lack of support for this module for the last 6 months. I will be revisiting this module soon to get it to a stable release, but i cannot make any further guarantees beyond a 1.0.

If anyone is interested in contributing, i would be more than happy to grant CVS access.

ck9’s picture

nickurbits I for one would be really grateful as this module is central to my site's intended function.

I applied the patch in #4 and it worked - the node now publishes on checkout.

I do get the following error however: -

user warning: Duplicate entry '68' for key 1 query: INSERT INTO node_expire (nid, expire, expired) VALUES (68, 0, 0) in /home/mainsite/public_html/subsite/includes/common.inc on line 3422.

Any ideas if this error will affect the site's functionality?

I have another unrelated question too. Editing a published and paid for node, then selecting 'Delete' seems to cancel the associated order. Is this intended? Wouldn't this mean that users can enjoy the benefits of having a node published, then be able to Delete it when they're done with it? Is there a way to deny users permission from deleting their published node, or at least not associate node deletion with order cancellation? Thanks

nicksanta’s picture

I'm revisiting this module over the next few days and seriously re-thinking some of the features that were originally implemented. I'm going to provide an admin UI and open up a whole range of configurable options including:

  • a wider range of core actions to perform on nodes.
  • pluggable actions
  • improved node actions / order status workflow
  • configurable time based actions, such as unpublishing certain products after a week etc..
  • custom notifications based on certain workflow events.
ck9’s picture

Sounds awesome will look forward to trying it

vlooivlerke’s picture

subscribe :)

fletch11’s picture

Thanks for this

avpaderno’s picture

Title: updating order » Error while updating the order
Status: Reviewed & tested by the community » Fixed

I applied the patch attached to comment #4, and committed the code in CVS.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.