From c4a40d8269b272bf263a4f24ca9a61d5828752e4 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 25 Mar 2016 21:51:50 +0100 Subject: fix #948 --- CHANGELOG.md | 1 + controller/pagecontroller.php | 7 ++++++- tests/unit/controller/PageControllerTest.php | 10 +++++----- 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); } -- cgit v1.2.3