]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix authors that have a mail or homepage
authorJoas Schilling <coding@schilljs.com>
Tue, 11 Oct 2016 08:23:45 +0000 (10:23 +0200)
committerJoas Schilling <coding@schilljs.com>
Tue, 11 Oct 2016 08:39:21 +0000 (10:39 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
settings/js/apps.js

index 2b2ec9abbb653357a4999f396cbfb32d47e7fade..ed2bae2dae3b88379cc3e0e6474698a1bbb8838f 100644 (file)
@@ -184,7 +184,15 @@ OC.Settings.Apps = OC.Settings.Apps || {
                }
 
                if (_.isArray(app.author)) {
-                       app.author = app.author.join(', ');
+                       var authors = [];
+                       _.each(app.author, function (author) {
+                               if (typeof author === 'string') {
+                                       authors.push(author);
+                               } else {
+                                       authors.push(author['@value']);
+                               }
+                       });
+                       app.author = authors.join(', ');
                }
 
                var html = template(app);
@@ -518,7 +526,21 @@ OC.Settings.Apps = OC.Settings.Apps || {
                // Author Name
                apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
                        if (_.isArray(app.author)) {
-                               return app.author.join(', ').toLowerCase().indexOf(query) !== -1;
+                               var authors = [];
+                               _.each(app.author, function (author) {
+                                       if (typeof author === 'string') {
+                                               authors.push(author);
+                                       } else {
+                                               authors.push(author['@value']);
+                                               if (!_.isUndefined(author['@attributes']['homepage'])) {
+                                                       authors.push(author['@attributes']['homepage']);
+                                               }
+                                               if (!_.isUndefined(author['@attributes']['mail'])) {
+                                                       authors.push(author['@attributes']['mail']);
+                                               }
+                                       }
+                               });
+                               return authors.join(' ').toLowerCase().indexOf(query) !== -1;
                        }
                        return app.author.toLowerCase().indexOf(query) !== -1;
                }));