Jump to:

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

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Go to End
Author Topic: 37668 Views
  • mdaum
    Avatar
    Community Member
    2 Posts

    Re: Bug Reports Link to this post

    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.php

    The 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?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bug Reports Link to this post

    You probably just need to grant read/write perms to apache on your assets directory.

  • moloko_man
    Avatar
    Community Member
    72 Posts

    Re: Bug Reports Link to this post

    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.

  • mdaum
    Avatar
    Community Member
    2 Posts

    Re: Bug Reports Link to this post

    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.

  • davidm2010
    Avatar
    Community Member
    107 Posts

    Re: Bug Reports Link to this post

    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

  • davidm2010
    Avatar
    Community Member
    107 Posts

    Re: Bug Reports Link to this post

    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?

  • SheaDawson
    Avatar
    Community Member
    44 Posts

    Re: Bug Reports Link to this post

    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]=100

    Line 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!

  • SheaDawson
    Avatar
    Community Member
    44 Posts

    Re: Bug Reports Link to this post

    Ok problem was I had deleted the folder in the file manager. Doh!

    37668 Views
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.