[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [17211] fix upgrade problem
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [17211] fix upgrade problem |
Date: |
Tue, 31 Oct 2017 10:41:43 -0400 (EDT) |
Revision: 17211
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17211
Author: sigurdne
Date: 2017-10-31 10:41:42 -0400 (Tue, 31 Oct 2017)
Log Message:
-----------
fix upgrade problem
Modified Paths:
--------------
trunk/property/inc/class.solocation.inc.php
Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2017-10-31 13:48:04 UTC (rev
17210)
+++ trunk/property/inc/class.solocation.inc.php 2017-10-31 14:41:42 UTC (rev
17211)
@@ -1281,10 +1281,18 @@
{
$values['attributes'] =
$this->custom->find('property', '.location.' . $type_id, 0, '', 'ASC',
'attrib_sort', true, true);
}
- $cols = "fm_location{$type_id}.id";
- $cols_return[] = 'id';
+ $metadata =
$this->db->metadata("fm_location{$type_id}");
+ //In case old version of property-app
+ $cols = '';
+ $cols_return = array();
- $cols .= ",fm_location{$type_id}.category as cat_id";
+ if(isset($metadata['id']))
+ {
+ $cols = "fm_location{$type_id}.id,";
+ $cols_return[] = 'id';
+ }
+
+ $cols .= "fm_location{$type_id}.category as cat_id";
$cols .= ",fm_location{$type_id}_category.descr as
category_name";
$cols_return[] = 'cat_id';
$cols_return[] = 'category_name';
@@ -1356,7 +1364,11 @@
//_debug_array($cols_return);
if(empty($values['id']))
{
- $this->update_location();
+ //In case old version of property-app
+ if(isset($metadata['id']))
+ {
+ $this->update_location();
+ }
}
$location[$location_code] = $values;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [17211] fix upgrade problem,
sigurdne <=