Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

image gallery assets directories and rights


Go to End


4 Posts   2004 Views

Avatar
George

Community Member, 41 Posts

30 November 2009 at 12:39pm

Hi,

because I haven't seen anymore my images I have done a new installation of image gallery (r331 with ss 2.3.4).
Under assets/image-gallery the directory of the image gallery page is created. But when I add an album this directory is not created. Which rights and which owner is needed?
Any other ideas what to check?

Thanks

Avatar
George

Community Member, 41 Posts

1 December 2009 at 9:40am

Hi UncleCheese,

I have checked now another complete new installation, the only modules dataobject, swfupload, image-gallery. The directory image-gallery was created but the album is not possible.
I have now a trace:

[Warning] mkdir(): Unable to access /<..>/httpdocs/assets/image-gallery/New-ImageGalleryPage-8/1/
POST /admin/EditForm/field/Albums/AddForm?ctf[Albums][start]=0&ctf[Albums][per_page]=10&ctf[Albums][showall]=0&ctf[Albums][sort]=SortOrder&ctf[Albums][sort_dir]=DESC&ctf[Albums][search]=&ctf[Albums][filter]=

Line 30 in /<..>/httpdocs/sapphire/filesystem/Folder.php
Source

21
22 foreach($parts as $part) {
23 $item = DataObject::get_one("Folder", "Name = '$part' AND ParentID = $parentID");
24 if(!$item) {
25 $item = new Folder();
26 $item->ParentID = $parentID;
27 $item->Name = $part;
28 $item->Title = $part;
29 $item->write();
30 if(!file_exists($item->getFullPath())) mkdir($item->getFullPath(),Filesystem::$folder_create_mask);
31 }
32 $parentID = $item->ID;
33 }
34 return $item;
35 }
36

Trace

* mkdir(/<..>/httpdocs/assets/image-gallery/New-ImageGalleryPage-8/1/,1533)
Line 30 of Folder.php
* Folder::findOrMake(image-gallery/New-ImageGalleryPage-8/1)
Line 63 of ImageGalleryAlbum.php
* ImageGalleryAlbum->onBeforeWrite()
Line 783 of DataObject.php
* DataObject->write()
Line 245 of DataObjectManager.php
* DataObjectManager->saveComplexTableField(Array,DataObjectManager_Popup,HTTPRequest)
Line 241 of Form.php
* Form->httpSubmission(HTTPRequest)
Line 129 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 143 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 143 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 143 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 119 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct(/admin/EditForm/field/Albums/AddForm)
Line 118 of main.php

Avatar
UncleCheese

Forum Moderator, 4102 Posts

1 December 2009 at 9:50am

Weird. I've never seen it before. Looks like more of an issue for the Folder class than anything else. You should be able to pass a path to the findOrMake() function regardless of which folders exist.

533 for the create mask seems awfully low to me. Can you try opening it up? Make sure Apache has read/write perms.

Avatar
George

Community Member, 41 Posts

20 December 2009 at 3:21pm

I haven't payed attention. It seems that I have changed the safe mode. Now it works correctly with safe mode off.