archesproject / arches

Arches is a web platform for creating, managing, & visualizing geospatial data. Arches was inspired by the needs of the Cultural Heritage community, particularly the widespread need of organizations to build & manage cultural heritage inventories
GNU Affero General Public License v3.0
212 stars 143 forks source link

Related Resources splash page broken when a user is not a Graph Editor #4010

Closed dwuthrich closed 6 years ago

dwuthrich commented 6 years ago

Clicking on the related resources node in the resource editor tree functions as expected in Chrome, but shows a broken data entry form in FF and Safari: http://recordit.co/ci8CtPAO5v

jmunowitch commented 6 years ago

I am not able to reproduce this on stable/4.3.x

jmunowitch commented 6 years ago

With @chiatt's suggestion, I was able to reproduce this with a provisional edit: screen shot 2018-08-30 at 13 55 22

Here is the console error:

TypeError: this.graph.domain_connections.forEach is not a function[Learn More] related-resources-manager.js:279:17
    initialize http://localhost:8000/media/js/views/resource/related-resources-manager.js:279:17
    e.View backbone.js:1224:4
    n backbone.js:1884:33
    vm.showRelatedResourcesManager/</< http://localhost:8000/media/js/views/resource/new-editor.js:259:50
    u http://localhost:8000/media/packages/jquery/dist/jquery.min.js:2:27452
    fireWith http://localhost:8000/media/packages/jquery/dist/jquery.min.js:2:28202
    k http://localhost:8000/media/packages/jquery/dist/jquery.min.js:2:77649
    n/< http://localhost:8000/media/packages/jquery/dist/jquery.min.js:2:79907
jmunowitch commented 6 years ago

And, I was able to reproduce this with Chrome as well. To reproduce: Make a provisional

  1. Make a provisional edit with a Provisional Editor
  2. Load the resource editor up with a separate user who is a part of the Resource Editor, Resource Reviewer and Crowdsource Editor groups (but NOT the Graph Editor group)
  3. Click on Related Resources.

This attempts to load the Graph Editor page: http://localhost:8000/graph/ab74af76-fa0e-11e6-9e3e-026d961c88e6/get_domain_connections?ontology_class=http%3A%2F%2Fwww.cidoc-crm.org%2Fcidoc-crm%2FE18_Physical_Thing. Since that user is not a Graph Editor, instead of receiving JSON back, it is pointed to the login page, which causes the TypeError above.

chiatt commented 6 years ago

@jmunowitch Hi Jeff - Could you QA this in 4.3.x and master?

jmunowitch commented 6 years ago

Reviewed and looks good on my end in both stable/4.3.x and master.