check if method getAutoincrementFields exists
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 9 Sep 2016 17:05:16 +0000 (19:05 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Sun, 11 Sep 2016 15:22:40 +0000 (17:22 +0200)
Change-Id: I5f377a9a3d2123ccb2ebeb8758896be5c89a2cbd
Reviewed-on: http://gerrit.tine20.com/customers/3556
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Controller/Record/Abstract.php

index 09f8428..2c08c90 100644 (file)
@@ -648,6 +648,12 @@ abstract class Tinebase_Controller_Record_Abstract
             return;
         }
 
+        if (! method_exists($configuration, 'getAutoincrementFields')) {
+            if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__
+                . ' CLass has no getAutoincrementFields(): ' . get_class($configuration));
+            return;
+        }
+
         foreach ($configuration->getAutoincrementFields() as $fieldDef) {
             $createNewValue = false;
             $checkValue = false;