0012862: relation type cannot be set/changed
authorCornelius Weiß <c.weiss@metaways.de>
Mon, 27 Mar 2017 11:42:25 +0000 (13:42 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 28 Mar 2017 13:43:33 +0000 (15:43 +0200)
Change-Id: If3b75b0c17e848dd4b2cf0a623f61e5090a0b05a
Reviewed-on: http://gerrit.tine20.com/customers/4432
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Tinebase/Frontend/JsonTest.php
tine20/Tinebase/Frontend/Json.php

index 1004cda..42720e0 100644 (file)
@@ -533,6 +533,7 @@ class Tinebase_Frontend_JsonTest extends TestCase
 
         $this->assertTrue(isset($registryData['Timetracker']['models']['Timeaccount']['copyOmitFields']), 'Timeaccount copyOmitFields empty/missing');
         $this->assertEquals($copyOmitFields, $registryData['Timetracker']['models']['Timeaccount']['copyOmitFields']);
+        $this->assertTrue(is_array(($registryData['Timetracker']['relatableModels'][0])), 'relatableModels needs to be an numbered array');
     }
 
     /**
index 7e4792b..c27ff23 100644 (file)
@@ -959,7 +959,7 @@ class Tinebase_Frontend_Json extends Tinebase_Frontend_Json_Abstract
 
         // TODO get this from app controller / modelconfig
         foreach ($applicationJson->getRelatableModels() as $relModel) {
-            $registryData[$relModel['ownApp']]['relatableModels'][] = $relModel;
+            $registryData['relatableModels'][] = $relModel;
         }
         $registryData['models'] = $applicationJson->getModelsConfiguration();
         $registryData['defaultModel'] = $applicationJson->getDefaultModel();