]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix single author with details
authorJoas Schilling <coding@schilljs.com>
Fri, 11 Nov 2016 13:11:19 +0000 (14:11 +0100)
committerJoas Schilling <coding@schilljs.com>
Fri, 11 Nov 2016 13:11:19 +0000 (14:11 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
settings/js/apps.js

index 654756af5314e4d006836f7d7aa3c330798f36e6..451becc67a0f1dfed7d690d799b69b4a152f1f8c 100644 (file)
@@ -189,6 +189,8 @@ OC.Settings.Apps = OC.Settings.Apps || {
                                }
                        });
                        app.author = authors.join(', ');
+               } else if (typeof app.author !== 'string') {
+                       app.author = app.author['@value'];
                }
 
                var html = template(app);
@@ -539,8 +541,8 @@ OC.Settings.Apps = OC.Settings.Apps || {
 
                // Author Name
                apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
+                       var authors = [];
                        if (_.isArray(app.author)) {
-                               var authors = [];
                                _.each(app.author, function (author) {
                                        if (typeof author === 'string') {
                                                authors.push(author);
@@ -555,6 +557,15 @@ OC.Settings.Apps = OC.Settings.Apps || {
                                        }
                                });
                                return OC.Settings.Apps._search(authors.join(' '), query);
+                       } else if (typeof app.author !== 'string') {
+                               authors.push(app.author['@value']);
+                               if (!_.isUndefined(app.author['@attributes']['homepage'])) {
+                                       authors.push(app.author['@attributes']['homepage']);
+                               }
+                               if (!_.isUndefined(app.author['@attributes']['mail'])) {
+                                       authors.push(app.author['@attributes']['mail']);
+                               }
+                               return OC.Settings.Apps._search(authors.join(' '), query);
                        }
                        return OC.Settings.Apps._search(app.author, query);
                }));