1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-18 07:52:21 +01:00

Make sure all address books are activated on upgrade.

Workaround for the regression that address books can't
be (de)activated.
This commit is contained in:
Thomas Tanghus 2013-05-23 13:17:19 +02:00
parent eba736a03b
commit 143a97f832

View File

@ -1,7 +1,12 @@
<?php
$installedVersion=OCP\Config::getAppValue('contacts', 'installed_version');
if (version_compare($installedVersion, '0.2.3', '<')) {
if (version_compare($installedVersion, '0.2.5', '>=')) {
// Set all address books active as (de)activating went awol at rewrite.
$stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*contacts_addressbooks` SET `active`= 1' );
$result = $stmt->execute(array());
}
elseif (version_compare($installedVersion, '0.2.4', '==')) {
// First set all address books in-active.
$stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*contacts_addressbooks` SET `active`=0' );
$result = $stmt->execute(array());