Tinebase Update Script - treat simplexml more gently
authorPaul Mehrer <p.mehrer@metaways.de>
Mon, 31 Jul 2017 10:30:06 +0000 (12:30 +0200)
committerPaul Mehrer <p.mehrer@metaways.de>
Mon, 31 Jul 2017 12:21:17 +0000 (14:21 +0200)
some applications may not have a xml definition of tables.

Change-Id: I7457bed2c499650469f83d00e187855efaf80b37
Reviewed-on: http://gerrit.tine20.com/customers/5356
Reviewed-by: Paul Mehrer <p.mehrer@metaways.de>
Tested-by: Paul Mehrer <p.mehrer@metaways.de>
tine20/Tinebase/Setup/Update/Release10.php

index a0bdb5a..025702d 100644 (file)
@@ -2035,6 +2035,9 @@ class Tinebase_Setup_Update_Release10 extends Setup_Update_Abstract
         /** @var Tinebase_Model_Application $application */
         foreach ($applications as $application) {
             $setupXml = Setup_Controller::getInstance()->getSetupXml($application->name);
+            if (!$setupXml || !$setupXml->tables || !$setupXml->tables->table) {
+                continue;
+            }
             foreach ($setupXml->tables->table as $key => $table) {
                 /** @var SimpleXMLElement $field */
                 foreach ($table->declaration->field as $field) {