Ticket #1772: rdf-creator-foaf.patch

File rdf-creator-foaf.patch, 749 bytes (added by fbennett, 6 years ago)

Replacing previous patch. This will apply cleanly to the trunk.

  • RDF.js

    old new  
    6868                return; 
    6969        } 
    7070         
    71         if(typeof(creators[0]) != "string") {   // see if creators are in a container 
    72                 try { 
    73                         var creators = Zotero.RDF.getContainerElements(creators[0]); 
    74                 } catch(e) {} 
     71        if(typeof(creators[0]) != "string") { 
     72                if(typeof(creators[0]) != "string") { 
     73                        // see if creators are in a container, but if they don't seem to be, 
     74                        // then we don't attempt to extract them. 
     75                        var newCreators = Zotero.RDF.getContainerElements(creators[0]); 
     76                        if (creators.length === newCreators.length) { 
     77                                creators = newCreators; 
     78                        } 
     79                } 
    7580        } 
    7681         
    7782        if(typeof(creators[0]) == "string") {   // support creators encoded as strings