7912 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Bug Reports
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 37668 Views |
-
Re: Bug Reports

10 March 2011 at 10:29am Last edited: 10 March 2011 10:30am
Hello,
I'm getting a rather funky issue with the latest trunks of ImageGallery, DOM, and Uploadify installed on a stock 2.4.4 install of SilverStripe.Every time I try changing a page to ImageGallery type, if I click save it works. If I click Save & Publish, it'll give me this error:
Error: Uncaught Exception: Cannot move .../assets/image-gallery/Images-2/ to .../assets/image-gallery/Images-2/
At line 422 in .../sapphire/filesystem/File.phpThe relevant code in File.php being (with line 422 labeled):
public function updateFilesystem() {
// Regenerate "Filename", just to be sure
$this->setField('Filename', $this->getRelativePath());
// If certain elements are changed, update the filesystem reference
if(!$this->isChanged('Filename')) return false;
$changedFields = $this->getChangedFields();
$pathBefore = $changedFields['Filename']['before'];
$pathAfter = $changedFields['Filename']['after'];
// If the file or folder didn't exist before, don't rename - its created
if(!$pathBefore) return;
$pathBeforeAbs = Director::getAbsFile($pathBefore);
$pathAfterAbs = Director::getAbsFile($pathAfter);
// TODO Fix Filetest->testCreateWithFilenameWithSubfolder() to enable this
// // Create parent folders recursively in database and filesystem
// if(!is_a($this, 'Folder')) {
// $folder = Folder::findOrMake(dirname($pathAfterAbs));
// if($folder) $this->ParentID = $folder->ID;
// }
// Check that original file or folder exists, and rename on filesystem if required.
// The folder of the path might've already been renamed by Folder->updateFilesystem()
// before any filesystem update on contained file or subfolder records is triggered.
if(!file_exists($pathAfterAbs)) {
if(!is_a($this, 'Folder')) {
// Only throw a fatal error if *both* before and after paths don't exist.
if(!file_exists($pathBeforeAbs)) throw new Exception("Cannot move $pathBefore to $pathAfter - $pathBefore doesn't exist");
// Check that target directory (not the file itself) exists.
// Only check if we're dealing with a file, otherwise the folder will need to be created
if(!file_exists(dirname($pathAfterAbs))) throw new Exception("Cannot move $pathBefore to $pathAfter - Directory " . dirname($pathAfter) . " doesn't exist");
}
// Rename file or folder
$success = rename($pathBeforeAbs, $pathAfterAbs);
if(!$success) throw new Exception("Cannot move $pathBeforeAbs to $pathAfterAbs"); //Line 422
}
// Update any database references
$this->updateLinks($pathBefore, $pathAfter);
}
When/if it works (by clicking Publish and waiting, sometimes it actually does it), it often obfusticates certain images/albums, by pointing to non-existent assets.My guess is that it may have something to do with permissions (i.e. not being able to create the needed files), however one would (reasonably) assume that the rest of silverstripe would have an issues (especially at install time). Note please that I have not messed with permissions since install.
A stock 2.4.5 has the same issue.
Any ideas/need anything else?
-
Re: Bug Reports

10 March 2011 at 10:56am
You probably just need to grant read/write perms to apache on your assets directory.
-
Re: Bug Reports

10 March 2011 at 11:44am Last edited: 10 March 2011 11:44am
I had that same issue mdaum and had to set write permissions to assets and every image-gallery folder and it's sub folders. Once I did that everything worked peachy.
-
Re: Bug Reports

11 March 2011 at 7:36am Last edited: 11 March 2011 7:39am
Well, I had the server admin chmod 777 the whole directory, and I'm still having the same issue... Any other idears?
EDIT: The pagetype change works for the draft site, and works when you view the draft site, but is not translating over to the published site.
-
Re: Bug Reports

15 March 2011 at 4:31am
I have started having troubles as well. I am using 4.2.2, module 34f64c0. When a create a new image page, it doesn't show up in the CMS until I refresh the page. I have no other problems with other pages. When I refresh and change the title, I get an error saving content. If I try to change the page type, it gives me a save, be defaults back to the first page in the list and does not give me the image gallery page options.
I have removed the gallery, dropped the tables in the database, rebuilt but can't seem to get it working again. Thoughts?
DM
-
Re: Bug Reports

15 March 2011 at 7:14am
OK, I am now getting the image gallery to work, but I had to use 2.4.5 and the code download from leftandmain. Now I have done something to my file and images section. When I select it, I thorws me to a site error page. I know I have screwed something up chasing the image gallery issue. Any thoughts?
-
Re: Bug Reports

15 March 2011 at 2:56pm
I'm having a problem with Image Gallery on SS 2.4.5. I've tried the latest gallery release and trunk version from git.
When uploading images, the upload works fine but after clicking continue I receive this error:
[Notice] Trying to get property of non-object
POST /admin/EditForm/field/GalleryItems/UploadifyForm?SecurityID=7dcd5a408c673ebde9afccff1276a527c2076180&ctf[GalleryItems][start]=0&ctf[GalleryItems][per_page]=10&ctf[GalleryItems][showall]=0&ctf[GalleryItems][sort]=SortOrder&ctf[GalleryItems][sort_dir]=&ctf[GalleryItems][search]=&ctf[GalleryItems][filter]=AlbumID_2&ctf[GalleryItems][view]=grid&ctf[GalleryItems][imagesize]=100Line 418 in /Applications/MAMP/htdocs/silverstripe/nttanks/dataobject_manager/code/FileDataObjectManager.php
I have not modified any code, this is straight after install.
Cheers for any help!
-
Re: Bug Reports

15 March 2011 at 3:09pm
Ok problem was I had deleted the folder in the file manager. Doh!
| 37668 Views | ||
| Go to Top | Next > |



