Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: info.xml interpretation not the latest #1466

Closed
janis91 opened this issue Sep 20, 2016 · 3 comments
Closed

Bug: info.xml interpretation not the latest #1466

janis91 opened this issue Sep 20, 2016 · 3 comments
Assignees
Labels

Comments

@janis91
Copy link

janis91 commented Sep 20, 2016

Steps to reproduce

  1. Install for example the next notes app from the appstore. (An app with language attribute and multiple name tags in the info.xml is required)
  2. got to /index.php/settings/apps?category=enabled#

Expected behaviour

I would expect the app list.

Actual behaviour

Enabled site shows loading state forever.

Server configuration

Operating system: Linux (Debian 8)

Web server: Php Test server

Database: Postgre 9.4

PHP version: 5.6

Nextcloud version: (see Nextcloud admin page)
11.0 alpha / but seems to be the same on 10 (because this issue for my app was reported with version 10)

Updated from an older Nextcloud/ownCloud or fresh install:
no

Where did you install Nextcloud from:
git

The other topics of the report template are not necessary. I know the reason of the bug.

Client configuration

Browser:
Firefox 45

Operating system:
Debian 8

Logs

Web server error log

Web server error log

[Tue Sep 20 15:43:20 2016] Array to string conversion at /server/settings/Controller/AppSettingsController.php#204
[Tue Sep 20 15:43:20 2016] Array to string conversion at /server/settings/Controller/AppSettingsController.php#203
#### Nextcloud log (data/nextcloud.log)

(I know the time of the webserver is set wrong, but it's the same call.)

Nextcloud log

{"reqId":"I+cw\/09tssdKURXaW\/Fd","remoteAddr":"::1","app":"PHP","message":"Array to string conversion at \/server\/settings\/Controller\/AppSettingsController.php#204","level":0,"time":"2016-09-20T13:43:20+00:00","method":"GET","url":"\/index.php\/settings\/apps\/list?category=enabled&includeUpdateInfo=0","user":"admin"}
{"reqId":"I+cw\/09tssdKURXaW\/Fd","remoteAddr":"::1","app":"PHP","message":"Array to string conversion at \/server\/settings\/Controller\/AppSettingsController.php#203","level":0,"time":"2016-09-20T13:43:20+00:00","method":"GET","url":"\/index.php\/settings\/apps\/list?category=enabled&includeUpdateInfo=0","user":"admin"}
#### Browser log

Actually I don't know exactly if this has the same reason.

Browser log

TypeError: t.charAt is not a function
OC.Util._chunkify()
 js.js:1881
OC.Util.naturalSortCompare()
 js.js:1904
OC.Settings.Apps<.loadCategory/this._loadCategoryCall<.success/<()
 apps.js:103
OC.Settings.Apps<.loadCategory/this._loadCategoryCall<.success()
 apps.js:100
n.Callbacks/j()
 jquery.min.js:2
n.Callbacks/k.fireWith()
 jquery.min.js:2
x()
 jquery.min.js:4
.send/b/<()
#### Recommended Solution

I would recommend to change the necessary lines of code, which read the info.xml, because the defintion changed in some points (info.xsd).
The reason of this specific bug is the following: in lines 203 and 204 (also 238/239 and maybe other lines as well) of the AppSettingsController.php (method: listApps) the tags of the info.xml are read.

$apps = $this->getInstalledApps($includeUpdateInfo);
                    usort($apps, function ($a, $b) {
                        $a = (string)$a['name'];
                        $b = (string)$b['name'];
                        if ($a === $b) {
                            return 0;
                        }
                        return ($a < $b) ? -1 : 1;
                    });

The new name tag's max occurrences number is unbounded as of the info.xsd:
<xs:element name="name" type="l10n-string" minOccurs="1" maxOccurs="unbounded"/>

Because of this the method has to be changed in a way, that supports multiple name tags. (l10n support)

Maybe there are other occurrences and other interpreted tags as well, which have to be changed.

@nickvergessen nickvergessen self-assigned this Sep 22, 2016
@nickvergessen nickvergessen added this to the Nextcloud 11.0 milestone Sep 22, 2016
@JSoko
Copy link
Member

JSoko commented Sep 30, 2016

This isn't fixed in nc 10.0.1

@janis91
Copy link
Author

janis91 commented Sep 30, 2016

Same here. But I think, as the milestone says: It is aimed for NC 11 not for 10 ;-)

@nickvergessen
Copy link
Member

Patch is at #1586
Feel free to test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants