Opened 11 years ago

Closed 11 years ago

#1226 closed defect (fixed)

Dont display download/wms links when not connected and no rights granted

Reported by: landry Owned by: geonetwork-devel@…
Priority: major Milestone: v2.10.0 RC0
Component: General Version: v2.8.0RC2
Keywords: Cc: fxprunayre@…

Description

In ticket #1107 the display of wms/download links was reworked - the way it is now in master, if you have a metadata with WMS or download links, the code in MetadataResultsView.js:displayLinks() will create a linkButton object regardless of allowDynamic/allowDownload and add it to the view - thus if you dont have rights to view in interactive map/download, an empty extjs menu will be created & added to the view but not populated.

This is probably because the latest linkButton is added in line 619 if it is not null while the length of the array should also be checked like its done on line 572.

Attachments (1)

dont-add-empty-link-menu.diff (1.0 KB ) - added by landry 11 years ago.
git diff

Download all attachments as: .zip

Change History (3)

comment:1 by landry, 11 years ago

@@ -616,7 +615,7 @@ GeoNetwork.MetadataResultsView = Ext.extend(Ext.DataView, {
                         
                     });
                     // Add the latest button
-                    if (linkButton !== null) {
+                    if (linkButton !== null && linkButton.length !== 0) {
                         view.addLinkMenu(linkButton, label, currentType, el);
                     }
                     

Fixes the issue here.

by landry, 11 years ago

git diff

comment:2 by ianwallen, 11 years ago

Resolution: fixed
Status: newclosed

Commit in master 4425ca17cc3ab2d7ed7f006763922f9ab6d48fa3

Note: See TracTickets for help on using tickets.