[ghelda-devel] [73] Correct two warning bugs in plugin Address.

[ Thread Index | Date Index | More lists.tuxfamily.org/ghelda-devel Archives ]


Revision: 73
Author:   odyx
Date:     2009-07-25 01:12:26 +0200 (Sat, 25 Jul 2009)

Log Message:
-----------
Correct two warning bugs in plugin Address.

Modified Paths:
--------------
    trunk/plugins/Address.php


Modified: trunk/plugins/Address.php
===================================================================
--- trunk/plugins/Address.php	2009-07-24 21:18:54 UTC (rev 72)
+++ trunk/plugins/Address.php	2009-07-24 23:12:26 UTC (rev 73)
@@ -295,7 +295,9 @@
             }
         }
 
-        if( !isset($addressId) ) {
+        if( $id_people == G_PEOPLE_ID_NEW )
+            $addressId = -1;
+        elseif( !isset($addressId) ) {
             // Just give me the damn address_id
             $query = sprintf("SELECT `%s` FROM `%s` WHERE `%s` = '%s' LIMIT 1",
                     G_ADDRESS_ID,
@@ -340,7 +342,7 @@
         while($row =& $queryR->fetchRow()) {
             unset($destFields);
             foreach( $this->configH[$this->name]['select']['list'] as $fieldName) {
-                if( stripos($this->fields[$fieldName]['type'],'COUNTRY') !== false ) {
+                if( stripos($this->fields[$fieldName]['type'],'COUNTRY') !== false && !is_null($row[$fieldName]) ) {
                     $destFields[] = reset($this->_parent->functionality('getCountryCode',$row[$fieldName]));
                 } else {
                     $destFields[] = $row[$fieldName];


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/