Topic: Single and Double Quotes in Item Description Editing Fix

When we try to edit the items in an purchase order where the Item Description is set to non-editable and contained double quotes, it was unnecessarily mangling a hidden POST variable and then messing up the purch_order_details table's item_description field. Also one instance of assignment duplication  stands removed.

--- includes/ui/po_ui.inc    Mon Sep 29 21:21:28 2014
+++ includes/ui/po_ui.inc    Wed Dec 31 07:50:07 2014
@@ -382,7 +382,6 @@
         if ($order->line_items[$id]->descr_editable)
             text_cells(null,'item_description', null, 45, 150);
         else {
-            hidden('item_description', $_POST['item_description']);
 //            label_cell($_POST['item_description']);
             label_cell($order->line_items[$id]->item_description); 
         }
@@ -394,7 +393,7 @@
     {
 //        hidden('line_no', ($_SESSION['PO']->lines_on_order + 1));
 
-        //Chaitanya : Manufcatured item can be purchased
+        //Chaitanya : Manufactured item can be purchased
         stock_items_list_cells(null, 'stock_id', null, false, true, false, true);
         //stock_purchasable_items_list_cells(null, 'stock_id', null, false, true, true);
         if (list_updated('stock_id')) {
--- includes/po_class.inc    Mon Sep 29 21:21:28 2014
+++ includes/po_class.inc    Wed Dec 31 07:45:31 2014
@@ -74,7 +74,6 @@
         $this->line_items[$line_no]->quantity = $qty;
         $this->line_items[$line_no]->price = $price;
         $this->line_items[$line_no]->req_del_date = $req_del_date;
-        $this->line_items[$line_no]->item_description = $description;
     }
 
     function remove_from_order($line_no)
--- po_entry_items.php    Mon Sep 29 21:21:28 2014
+++ po_entry_items.php    Wed Dec 31 07:45:30 2014
@@ -261,7 +261,7 @@
         }
     
         $_SESSION['PO']->update_order_item($_POST['line_no'], input_num('qty'), input_num('price'),
-              @$_POST['req_del_date'], $_POST['item_description'] );
+              @$_POST['req_del_date'], @$_POST['item_description'] );
         unset_form_variables();
     }    
     line_start_focus();
Post's attachments

NonEditableItemDescPatch.zip 12.9 kb, 1 downloads since 2014-12-31 

You don't have the permssions to download the attachments of this post.