thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

Media library does not display folders while accessing it in CRUD view #5621

Closed toto975 closed 2 years ago

toto975 commented 2 years ago

Laravel version

9.x

PHP version

8.4.1

Voyager version

1.5

Database

MySQL 8.0.28

Description

I think this bug https://github.com/the-control-group/voyager/issues/4774 is not resolved.

Steps to reproduce

Here is the folder on the disk for the 'actualites' model : image

In the media library, no problem, all folders and files are displayed image

But when i want to create a 'Actualite', only files appear in the media picker image

Expected behavior

Folders must appear in the media picker when creating/updating a model.

Screenshots

When i check the json datas for media library and media picker, it's the same. The files and folders are here

image

image

So some problem for media picker in some javascript ?

Additional context

No response

emptynick commented 2 years ago

There's an option show_folders which the docs say is default true but from what I'm seeing its default false. Try to set that to true.

toto975 commented 2 years ago

It's already set to true image

If i set it to false, no folders appear in the media library and in the media picker.

toto975 commented 2 years ago

In the media library browser source code, there is this tag :

<div id="filemanager">
                    <media-manager
                        base-path="/"
                        :show-folders="true"
                        :allow-upload="true"
                        :allow-move="true"
                        :allow-delete="true"
                        :allow-create-folder="true"
                        :allow-rename="true"
                        :allow-crop="true"
                        :details="{&quot;thumbnails&quot;:[],&quot;watermark&quot;:{}}"
                        ></media-manager>
                </div>

which is used by

<script>
    Vue.component('media-manager', {
        template: `<div>
...

In the the create/update view of a model with a media picker, this tag doesn' appear.

emptynick commented 2 years ago

You are mixing media manager and media picker here. While both use the same views and JavaScript they can be configured independent. Check the docs for the media picker

toto975 commented 2 years ago

Thank you emptynick I hadn't understood that it was necessary to put the parameters in the optional details of the media picker in the bread.

image

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.