spin-up-statamic icon indicating copy to clipboard operation
spin-up-statamic copied to clipboard

Assets Fieldtype "Browse" function not working

Open xaviermatos opened this issue 2 years ago • 2 comments

Describe the bug

Whenever I try to select content from the "Browse" button using the Assets Fieldtype, it always is slow to load and then freezes at the end of the loading process. I can only upload files directly on the field to use it.

To reproduce

Steps to reproduce the behaviour:

  1. Download the Spin-up-Statamic CMS and run it in local dev.
  2. Once it is started up, create a Blueprint or edit one and add an Assets Field from Create Field.
  3. Set the Max and Min files to at least one and set the container of the Assets Field to "Assets".
  4. Go into Pages and make sure the Blueprint with the Asset Field you set is selected.
  5. Click the "Browse" button in the Assets Field, select a file, and open up the console on your browser.
  6. See error messages "GET http://localhost:8050/cp/assets-fieldtype?assets[]=assets::testimages%2Ftestimage3-1688939123.png 404 (Not Found)" and "Uncaught (in promise) Error: Request failed with status code 404 at createError (app-3beb22f3.js:377:184785) at settle (app-3beb22f3.js:377:185061) at XMLHttpRequest.ue (app-3beb22f3.js:378:2002)".

Expected behaviour

The files load in from the "Browse" function on the Assets Fieldtype and display in the Fieldtype as a selected file.

Screenshot

Broken_ Browse _Button

Versions

  • Statamic version: 4.9.2

xaviermatos avatar Jul 10 '23 19:07 xaviermatos

hmmmm... probably something with how the asset routing works that I'm not understanding fully.

Does the request http://localhost:8050/cp/assets-fieldtype?assets%5B%5D=assets::testimages%2Ftestimage3-1688939123.png look correct to you in terms of what you'd expect to see?

khalwat avatar Jul 24 '23 17:07 khalwat

I don't see an assets-fieldtype directory in my cp directory for this spin-up-statmic. I can see the photos saved in the Statamic folders being located in the statamic directory in the glide/containers directory and in that directory being saved in the assets directory within it. So statamic/glide/assets.

xaviermatos avatar Jul 24 '23 20:07 xaviermatos