fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [16534] Booking: fix socommon


From: sigurdne
Subject: [Fmsystem-commits] [16534] Booking: fix socommon
Date: Tue, 4 Apr 2017 09:23:13 -0400 (EDT)

Revision: 16534
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16534
Author:   sigurdne
Date:     2017-04-04 09:23:12 -0400 (Tue, 04 Apr 2017)
Log Message:
-----------
Booking: fix socommon

Modified Paths:
--------------
    trunk/booking/inc/class.socommon.inc.php
    trunk/phpgwapi/inc/class.socommon.inc.php

Modified: trunk/booking/inc/class.socommon.inc.php
===================================================================
--- trunk/booking/inc/class.socommon.inc.php    2017-04-04 08:28:19 UTC (rev 
16533)
+++ trunk/booking/inc/class.socommon.inc.php    2017-04-04 13:23:12 UTC (rev 
16534)
@@ -559,6 +559,7 @@
                                {
                                        if ($params['manytomany'])
                                        {
+                                               $row[$field] = array();
                                                $table = 
$params['manytomany']['table'];
                                                $key = 
$params['manytomany']['key'];
                                                $ids = join(',', 
array_keys($id_map));
@@ -572,7 +573,6 @@
                                                        $colnames = join(',', 
$colnames);
 
                                                        
$this->db->query("SELECT $colnames, $key FROM $table WHERE $key IN($ids)", 
__LINE__, __FILE__);
-                                                       $row[$field] = array();
                                                        while 
($this->db->next_record())
                                                        {
                                                                $id = 
$this->_unmarshal($this->db->f($key, false), 'int');
@@ -601,11 +601,13 @@
                                                {
                                                        $column = 
$params['manytomany']['column'];
                                                        
$this->db->query("SELECT $column, $key FROM $table WHERE $key IN($ids)", 
__LINE__, __FILE__);
-                                                       $row[$field] = array();
                                                        while 
($this->db->next_record())
                                                        {
                                                                $id = 
$this->_unmarshal($this->db->f($key, false), 'int');
-                                                               
$results[$id_map[$id]][$field] = array();
+                                                               
if(!isset($results[$id_map[$id]][$field]))
+                                                               {
+                                                                       
$results[$id_map[$id]][$field] = array();
+                                                               }
                                                                
$results[$id_map[$id]][$field][] = $this->_unmarshal($this->db->f($column, 
false), $params['type']);
                                                        }
                                                }

Modified: trunk/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.socommon.inc.php   2017-04-04 08:28:19 UTC (rev 
16533)
+++ trunk/phpgwapi/inc/class.socommon.inc.php   2017-04-04 13:23:12 UTC (rev 
16534)
@@ -286,6 +286,7 @@
                                        }
                                        if ($params['manytomany'])
                                        {
+                                               $row[$field] = array();
                                                $table = 
$params['manytomany']['table'];
                                                $key = 
$params['manytomany']['key'];
                                                $ids = join(',', 
array_keys($id_map));
@@ -299,7 +300,7 @@
                                                        $colnames = join(',', 
$colnames);
 
                                                        
$this->db->query("SELECT $colnames, $key FROM $table WHERE $key IN($ids)", 
__LINE__, __FILE__);
-                                                       $row[$field] = array();
+
                                                        while 
($this->db->next_record())
                                                        {
                                                                $id = 
$this->unmarshal($this->db->f($key, false), 'int');
@@ -328,11 +329,13 @@
                                                {
                                                        $column = 
$params['manytomany']['column'];
                                                        
$this->db->query("SELECT $column, $key FROM $table WHERE $key IN($ids)", 
__LINE__, __FILE__);
-                                                       $row[$field] = array();
                                                        while 
($this->db->next_record())
                                                        {
                                                                $id = 
$this->unmarshal($this->db->f($key, false), 'int');
-                                                               
$results[$id_map[$id]][$field] = array();
+                                                               
if(!isset($results[$id_map[$id]][$field]))
+                                                               {
+                                                                       
$results[$id_map[$id]][$field] = array();
+                                                               }
                                                                
$results[$id_map[$id]][$field][] = $this->unmarshal($this->db->f($column, 
false), $params['type']);
                                                        }
                                                }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]