Upgrading dotcms 2.5.7 to 3.7.2 $folder = $fileRepository_filesList.get(0).folder - won't return folder id

84 views Asked by At

I upgraded dotcms from 2.5.7 to 3.7.2.

The following code is actually linked to a button which opens a slideshow.

This code was working in old cms, but won't in the 3.7.2 Funny thing! - If I am not logged in in the backend this code works otherwise it won't.

To view the button for slideshow itself you need to be logged in, but not in the backend! What am I missing guys?

How should I get list of files from folder which have 4 children (folders in it), that contains pictures and then I could use it with JavaScript?

#set($folder = $fileRepository_filesList.get(0).folder) - this line should return id of the folder, but does not return anything (it's just $folder). If I'm logged in the backend this line returns id(61763395-ca41-4446-95cc-4ddfbaaf0cea). Why?

Thank you so much for the help!

1

There are 1 answers

1
wezell On

So my guess would be that CMS Anon does not have read access to the files. You could try to get the folder ID using something like,

$folderAPI.findCurrentFolder("/path", $host).id

where the path is the folder path you are looking for. Also, why would you be upgrading from an EOL'ed version to another EOL'ed version - you would be better off going to the latest version.