jcu-eresearch / matrix-helpers

100% Unguessable™. Public bug tracker, pages, designs and helpers that make life in Squiz Matrix easier. The metaphorical red pill.
https://jcu-eresearch.github.io/matrix-helpers/
GNU Affero General Public License v3.0
3 stars 0 forks source link

Edit+ Asset Finder errors and won't load if the Related Asset Metadata Field's value is a Git file ("Physical File") asset #114

Open davidjb opened 7 years ago

davidjb commented 7 years ago

Problem

Edit+'s Asset Finder fails to load and produces a JavaScript error if the value is set as a Physical File inside a Git Bridge.

To reproduce

  1. Create an empty Metadata Schema.
  2. Add a Related Asset metadata field to that Metadata Schema.
  3. Set that field's default value to be a file inside a Git Bridge (eg 12345:dist/images/foobar.svg)
  4. Create a new Site asset.
  5. Apply the Metadata Schema to the Site.
  6. View the Site in Edit+ and go to the 'Metadata' settings.
  7. Click the Select button in the given Related Asset metadata field.
  8. Note that the Asset Finder never loads and the browser's console errors:
TypeError: e is null[Learn More]  easyedit.min.js:358:96
    loadLineage https://example.com/__data/ees/easyedit.min.js:358:96
    init/</</< https://example.com/__data/ees/easyedit.min.js:342:149
    c https://example.com/__data/ees/easyedit.min.js:353:340
    loadDefaultPane/< https://example.com/__data/ees/easyedit.min.js:357:77
    run/< https://example.com/__data/ees/easyedit.min.js:114:426
    callNextBatch/< https://example.com/__data/ees/easyedit.min.js:122:490
    j https://example.com/__data/ees/easyedit.min.js:4:27131
    fireWith https://example.com/__data/ees/easyedit.min.js:4:27949
    Deferred/</e[f[0]] https://example.com/__data/ees/easyedit.min.js:4:28915
    buildDeferred/</e.dataCallback https://example.com/__data/ees/easyedit.min.js:125:461
    onSuccess https://example.com/_editplusapi:3426:8
    _http/http.onreadystatechange https://example.com/_editplusapi:175:8

This Asset Finder for this field is now out of action until you go to another Related Asset metadata field that works, click Select on it, wait for its Asset Finder to load and then go back, clear the Git Bridge default value, and click Select. The Asset Finder will load successfully that time.

Versions

Tested on Matrix 5.4.0.3 and corresponding Edit+ version.

davidjb commented 7 years ago

Reported at https://squizmap.squiz.net/matrix/11018

davidjb commented 7 years ago

Seems to have already been reported at https://squizmap.squiz.net/matrix/10568