Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with eval 'path' in file picker #6412

Open
zonky2 opened this issue Sep 27, 2023 · 8 comments
Open

Error with eval 'path' in file picker #6412

zonky2 opened this issue Sep 27, 2023 · 8 comments
Labels
Milestone

Comments

@zonky2
Copy link
Contributor

zonky2 commented Sep 27, 2023

Affected version(s)

4.13.30

Description

When I restrict the path in a DCA,

$GLOBALS['TL_DCA'][$strTblName]['fields']['mcwtest1'] =
    [
        'exclude'   => true,
        'inputType' => 'multiColumnWizard',
        'eval'      => [
            'minCount'     => 3,
            'maxCount'     => 5,
            'columnFields' => [
                'col_image'   => [
                    'label'     => 'Grundriss',
                    'exclude'   => true,
                    'inputType' => 'fileTree',
                    'eval'      => [
                        'fieldType'  => 'radio',
                        'files'      => true,
                        'filesOnly'  => true,
                        'extensions' => \Contao\Config::get('validImageTypes'),
                        'mandatory'  => true,
                        'path'       => 'files/content/images',
                    ],
                ],
...

At first, we see image 1:

bug_0

the following errors result:

  • if one clicks on a (sub)folder, no more files are displayed (image 1).
  • if you click on a level in the breadcrumb that is higher than the given path, nothing is shown anymore (picture 2)

Current workaround: if you know some of the image names, the search still works...

Image 2
bug_1

Image 3
bug_2

@asaage
Copy link

asaage commented Sep 27, 2023

first image = image 0 😂

What was your selected bredcrumb/current-dir in the filemanager beforehand?
I suspect it is related to an issue i experienced here

@zonky2
Copy link
Contributor Author

zonky2 commented Sep 27, 2023

see the path value: files/content/images

Image 0 : I thought somewhere the filenames are output... the first one starts with 0 ;-)

@asaage
Copy link

asaage commented Sep 27, 2023

see the path value: files/content/images

I dont mean your dca setting but the thing that is stored in session (or localstorage) when you go to the filemanager and click on the folder-icon of files/othercontent so it is displayed in the breadcrumb.
Is your fileTree-Input then able to show something from files/content/images?

@ausi
Copy link
Member

ausi commented Sep 27, 2023

Does this issue also appear if you do not use the multiColumnWizard widget?

@zonky2
Copy link
Contributor Author

zonky2 commented Sep 27, 2023

the same behavior occurs with MetaModels - there you can specify a starting point at file attribute

https://community.contao.org/de/showthread.php?85973-Kann-in-den-MMs-keine-Files-Bilder-erg%C3%A4nzen

I used the MCW to exclude MM or DCG and because it was easy to build a test case... with RST-CE this is surely also possible

@zonky2
Copy link
Contributor Author

zonky2 commented Nov 21, 2023

same bug at Contao (testet on C 4.13.34)

change at tl_content.php

'singleSRC' => array
(
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array('filesOnly'=>true, 'fieldType'=>'radio', 'mandatory'=>true, 'tl_class'=>'clr'),
'load_callback' => array
(
array('tl_content', 'setSingleSrcFlags')
),
'sql' => "binary(16) NULL"
),

and set your own path

        'singleSRC' => array
        (
            'exclude'       => true,
            'inputType'     => 'fileTree',
            'eval'          => array(
                'filesOnly'  => true,
                'fieldType'  => 'radio',
                'extensions' => \Contao\Config::get('validImageTypes'),
                'mandatory'  => true,
                'tl_class'   => 'clr',
                'path'       => 'files/content/images'
            ),
            'load_callback' => array
            (
                array('tl_content', 'setSingleSrcFlags')
            ),
            'sql'           => "binary(16) NULL"
        ),

@zonky2
Copy link
Contributor Author

zonky2 commented Dec 27, 2023

hat den jemand den Bug auf dem Schirm? insgesammt etwas misslich für die Usability ohne mögliche Vorauswahl :(

@leofeyer leofeyer added this to the 4.13 milestone Apr 20, 2024
@leofeyer
Copy link
Member

leofeyer commented Apr 20, 2024

The issue only occurs if the file manager breadcrumb menu is active:

@contao/developers How do we solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants