0

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!

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
pero58
  • 1
  • 1

1 Answers1

2

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.

wezell
  • 573
  • 3
  • 7
  • Thank you soooo much! It works with this code: #set($folder = $folderAPI.findCurrentFolder($fileSrc, $host)) #set($menuId = $folder.inode) I am upgrading to latest 3 version because that solves your problems. Upgrading to latest is too much hassle. We'll make new site from scratch next year – pero58 Oct 14 '19 at 07:04