News: Folders are collapsed on page reload

Created on 13 Jan 2021  路  2Comments  路  Source: nextcloud/news

IMPORTANT

Read and tick the following checkbox after you have created the issue or place an x inside the brackets ;)

  • [x] I have read the CONTRIBUTING.md and followed the provided tips
  • [x] I accept that the issue will be closed without comment if I do not check here
  • [x] I accept that the issue will be closed without comment if I don not fill out all items in the issue template.

Explain the Problem

What problem did you encounter?

When the news app is (re)loaded all folders are collapsed.
I'm not sure if this behaviour is intended, but I couldn't find anything in commit messages or the changelog.

Steps to Reproduce

Explain what you did to encounter the issue

  1. Open news app
  2. Open different folders
  3. Reload news app
  4. All folders are collapsed again

System Information

  • News app version: 15.1.1
  • Nextcloud version: 20.0.1
  • Cron type: System-Cron
  • PHP version: 7.4.11
  • Database and version: MariaDB 10.5.6
  • Browser and version: Firefox 84.0.2
  • Distribution and version: Ubuntu 20.04 LTS
bug

Most helpful comment

Can confirm and I don't think it's intended.
I can fix the opened state locally with the following, but I don't know whether it's the right place, whether it has side-effects and which other data were returned in older versions.

diff --git a/lib/Db/Folder.php b/lib/Db/Folder.php
index d452bb7d4..6f208309b 100644
--- a/lib/Db/Folder.php
+++ b/lib/Db/Folder.php
@@ -167,6 +167,7 @@ class Folder extends Entity implements IAPI, \JsonSerializable
             [
                 'id',
                 'name',
+                'opened',
                 'feeds'
             ]
         );

It probably changed in 8abddeab4f541883721d912f97dec07bffdfc6b8 with the switch to $this->serialize(). Any idea @SMillerDev?
https://github.com/nextcloud/news/blob/8abddeab4f541883721d912f97dec07bffdfc6b8/lib/Controller/FolderController.php#L65

All 2 comments

Can confirm and I don't think it's intended.
I can fix the opened state locally with the following, but I don't know whether it's the right place, whether it has side-effects and which other data were returned in older versions.

diff --git a/lib/Db/Folder.php b/lib/Db/Folder.php
index d452bb7d4..6f208309b 100644
--- a/lib/Db/Folder.php
+++ b/lib/Db/Folder.php
@@ -167,6 +167,7 @@ class Folder extends Entity implements IAPI, \JsonSerializable
             [
                 'id',
                 'name',
+                'opened',
                 'feeds'
             ]
         );

It probably changed in 8abddeab4f541883721d912f97dec07bffdfc6b8 with the switch to $this->serialize(). Any idea @SMillerDev?
https://github.com/nextcloud/news/blob/8abddeab4f541883721d912f97dec07bffdfc6b8/lib/Controller/FolderController.php#L65

It seems like earlier versions didn't serialize the folder because there is barely any data in there. I'd say that is the right fix @anoymouserver

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Refhi picture Refhi  路  8Comments

BlackIkeEagle picture BlackIkeEagle  路  3Comments

HanFox picture HanFox  路  4Comments

janumix picture janumix  路  7Comments

David-Development picture David-Development  路  3Comments