summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2016-03-25 21:51:50 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2016-03-25 21:51:50 +0100
commitc4a40d8269b272bf263a4f24ca9a61d5828752e4 (patch)
tree37eb10e0fa22d0cd0e0c2809997b78ea5cad8465
parent6e1386093d40901732a60f65a10971c1d91494ed (diff)
fix #948
-rw-r--r--CHANGELOG.md1
-rw-r--r--controller/pagecontroller.php7
-rw-r--r--tests/unit/controller/PageControllerTest.php10
3 files changed, 12 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bee1e9e30..d5acd3ebb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@ owncloud-news (7.2.0)
* **New dependency**: Bump required PostgreSQL version to 9.4
* **New dependency**: Bump required MySql/MariaDB version to 5.5
* **Bugfix**: Fix bug that would not lowercase non ASCII characters when searching, #944
+* **Bugfix**: Fix bug that would not persist settings like compact mode on postgres, #948
* **Enhancement**: Add HTTP basic auth, #938
* **Enhancement**: The git repository does not bundle composer and bower libraries anymore, nor does it contain compiled JavaScript. If you are running the git version, you now need to run **make** after cloning and pulling from the repository to install the depenencies and compile the JavaScript
diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php
index fab68b3d9..66471419a 100644
--- a/controller/pagecontroller.php
+++ b/controller/pagecontroller.php
@@ -144,8 +144,13 @@ class PageController extends Controller {
];
foreach ($settings as $setting) {
+ if (${$setting}) {
+ $value = '1';
+ } else {
+ $value = '0';
+ }
$this->settings->setUserValue($this->userId, $this->appName,
- $setting, ${$setting});
+ $setting, $value);
}
}
diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php
index 282b02857..5a0b3d0e8 100644
--- a/tests/unit/controller/PageControllerTest.php
+++ b/tests/unit/controller/PageControllerTest.php
@@ -240,31 +240,31 @@ class PageControllerTest extends \PHPUnit_Framework_TestCase {
->with($this->equalTo($this->user),
$this->equalTo($this->appName),
$this->equalTo('showAll'),
- $this->equalTo(true));
+ $this->equalTo('1'));
$this->settings->expects($this->at(1))
->method('setUserValue')
->with($this->equalTo($this->user),
$this->equalTo($this->appName),
$this->equalTo('compact'),
- $this->equalTo(true));
+ $this->equalTo('1'));
$this->settings->expects($this->at(2))
->method('setUserValue')
->with($this->equalTo($this->user),
$this->equalTo($this->appName),
$this->equalTo('preventReadOnScroll'),
- $this->equalTo(false));
+ $this->equalTo('0'));
$this->settings->expects($this->at(3))
->method('setUserValue')
->with($this->equalTo($this->user),
$this->equalTo($this->appName),
$this->equalTo('oldestFirst'),
- $this->equalTo(true));
+ $this->equalTo('1'));
$this->settings->expects($this->at(4))
->method('setUserValue')
->with($this->equalTo($this->user),
$this->equalTo($this->appName),
$this->equalTo('compactExpand'),
- $this->equalTo(true));
+ $this->equalTo('1'));
$this->controller->updateSettings(true, true, false, true, true);
}