Merge branch '2014.11-develop' into 2015.07
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 28 Oct 2015 08:57:27 +0000 (09:57 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 28 Oct 2015 08:57:27 +0000 (09:57 +0100)
Conflicts:
tine20/Felamimail/Setup/Update/Release8.php

Change-Id: I8c61597148a125a2bcec1986fdb7564dbb7290ba

1  2 
tine20/Calendar/js/Model.js
tine20/Felamimail/Setup/Update/Release8.php

Simple merge
@@@ -159,49 -159,40 +159,54 @@@ class Felamimail_Setup_Update_Release8 
       */
      public function update_4()
      {
 -        $backend = new Felamimail_Backend_Cache_Sql_Message();
 -        $db = $backend->getAdapter();
 -        $skip = false;
 +        $tableVersion = $this->getTableVersion('felamimail_cache_message');
  
 -        if ($db instanceof Zend_Db_Adapter_Pdo_Mysql) {
 -            try {
 -                if (!($stmt = $db->query('select @@innodb_version')) ||
 -                    !$stmt->setFetchMode(Zend_Db::FETCH_NUM) ||
 -                    !($row = $stmt->fetchAll())
 -                ) {
 +        if ($tableVersion < 10) {
 +            $backend = new Felamimail_Backend_Cache_Sql_Message();
 +            $db = $backend->getAdapter();
 +            $skip = false;
 +
 +            if ($db instanceof Zend_Db_Adapter_Pdo_Mysql) {
-                 if (!($stmt = $db->query('select @@innodb_version')) ||
-                     !$stmt->setFetchMode(Zend_Db::FETCH_NUM) ||
-                     !($row = $stmt->fetchAll())
-                 ) {
++                try {
++                    if (!($stmt = $db->query('select @@innodb_version')) ||
++                        !$stmt->setFetchMode(Zend_Db::FETCH_NUM) ||
++                        !($row = $stmt->fetchAll())
++                    ) {
++                        $skip = true;
++                    }
++                } catch (Exception $e) {
++                    Tinebase_Exception::log($e);
                      $skip = true;
                  }
 -            } catch (Exception $e) {
 -                Tinebase_Exception::log($e);
 -                $skip = true;
--            }
 -        }
  
-             if (!$skip) {
-                 $declaration = new Setup_Backend_Schema_Index_Xml(
-                     '<index>
-                          <name>account_id-folder_id</name>
-                          <field>
-                              <name>account_id</name>
-                          </field>
-                          <field>
-                              <name>folder_id</name>
-                          </field>
-                     </index>'
-                 );
-                 $this->_backend->addIndex('felamimail_cache_message', $declaration);
-             }
 -        if ( !$skip ) {
 -            $declaration = new Setup_Backend_Schema_Index_Xml(
 -                '<index>
 -                     <name>account_id-folder_id</name>
 -                     <field>
 -                         <name>account_id</name>
 -                     </field>
 -                     <field>
 -                         <name>folder_id</name>
 -                     </field>
 -                </index>'
 -            );
 -            $this->_backend->addIndex('felamimail_cache_message', $declaration);
 -        }
++                if (!$skip) {
++                    $declaration = new Setup_Backend_Schema_Index_Xml(
++                        '<index>
++                             <name>account_id-folder_id</name>
++                             <field>
++                                 <name>account_id</name>
++                             </field>
++                             <field>
++                                 <name>folder_id</name>
++                             </field>
++                        </index>'
++                    );
++                    $this->_backend->addIndex('felamimail_cache_message', $declaration);
++                }
  
-             $this->setTableVersion('felamimail_cache_message', '10');
 -        $this->setTableVersion('felamimail_cache_message', '10');
++                $this->setTableVersion('felamimail_cache_message', '10');
++            }
 +        }
          $this->setApplicationVersion('Felamimail', '8.5');
      }
 +
 +    /**
 +     * update to 9.0
 +     *
 +     * @return void
 +     */
 +    public function update_5()
 +    {
 +        $this->setApplicationVersion('Felamimail', '9.0');
 +    }
  }