Fixed error on add/update with no tags selected.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 22 Oct 2009 12:01:34 +0000 (12:01 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 22 Oct 2009 12:01:34 +0000 (12:01 +0000)
dimensions/dimension_entry.php
gl/manage/gl_accounts.php

index 626d8466914e5ca6a1b393c9b4c85542dfd952d1..0ff4a56e23622d25effe48f0decf9ceae239e4f4 100644 (file)
@@ -154,16 +154,16 @@ function can_process()
 
 if (isset($_POST['ADD_ITEM']) || isset($_POST['UPDATE_ITEM'])) 
 {
-
+       if (!isset($_POST['dimension_tags']))
+               $_POST['dimension_tags'] = array();
+               
        if (can_process()) 
        {
 
                if ($selected_id == -1) 
                {
-
                        $id = add_dimension($_POST['ref'], $_POST['name'], $_POST['type_'], $_POST['date_'], $_POST['due_date'], $_POST['memo_']);
                        add_tag_associations($id, $_POST['dimension_tags']);
-
                        meta_forward($_SERVER['PHP_SELF'], "AddedID=$id");
                } 
                else 
index 02a78bc763bf8c5e37a55cfbb1a8b71081001416..1f6786effeaa1637af2cf8dea75fd88ad57308a7 100644 (file)
@@ -71,6 +71,9 @@ if (isset($_POST['add']) || isset($_POST['update']))
                if ($accounts_alpha == 2)
                        $_POST['account_code'] = strtoupper($_POST['account_code']);
 
+               if (!isset($_POST['account_tags']))
+                       $_POST['account_tags'] = array();
+
        if ($selected_account) 
                {
                if (update_gl_account($_POST['account_code'], $_POST['account_name'],