statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

Bard not working with images in sets #2454

Closed dannyuk1982 closed 4 years ago

dannyuk1982 commented 4 years ago

Using Bard with this fieldset:

        type: bard
        container: main
        folder: img/work
        sets:
          image_single_set:
            display: 'Image (single)'
            fields:
              image:
                type: assets
                max_files: 1
                validate: 'ext:png,gif,jpg,jpeg,svg'
                container: main
                restrict: true
                folder: img/work/slides

Results in broken images. Looking at the HTML these are loading in as relative URLs so aren't valid links to the file on the server, i.e. https://server.test/cp/collections/entries/work/assets/img/blah.jpg instead of https://server.test/assets/img/blah.jpg

Deleting the image and adding it again doesn't work either.

Screenshot 2019-10-25 at 12 09 18

If I switch type: to replicator, it all works fine:

Screenshot 2019-10-25 at 12 06 43

On Statamic 2.11.15, PHP 7.3.10, Valet 2.5.1

dannyuk1982 commented 4 years ago

OK, so I went to CP > Content > Assets and added a / before the URL and this seems to work fine now. It's weird that it worked OK with replicator though, and also without the / the CP still said Valid URL under Content > Assets.