Jump to:

7938 Posts in 1540 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » ImageGalleryPage - Error Saving Content

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3 4 5 6 7
Go to End
Author Topic: 9161 Views
  • RidinHighSpeeds
    Avatar
    Community Member
    3 Posts

    Re: ImageGalleryPage - Error Saving Content Link to this post

    Thank you.. I'll give that a shot!

  • mephzara
    Avatar
    Community Member
    17 Posts

    Re: ImageGalleryPage - Error Saving Content Link to this post

    Hello

    I am currently programming a very simple page that contains a set of pictures. I am using the DataObjectManager and I am trying to change the upload folder. I use the ImageGallery module as an example and now I am getting the same errors as you in this thread. I can create the page but I cannot change the page name and save it.

    The problem is that the name of the new page and the name of the created folder differ. The page for example has the name NeuLZImageSetPage but the name of the folder is new-LZImageSetPage. After that the database and the filesystem are out of sync and each subsequent save fails because the folder cannot be renamed.

    In my case I have a german site. So the URL-Segment and the Page title differ. I suppose that is the problem. Maybe there are other situations where the title and the URL are different (maybe when a new page is created straight after another and Silverstripes appends page numbers). That could be also a hint that the whole thing works sometimes and sometimes not.

    Best regards

  • mephzara
    Avatar
    Community Member
    17 Posts

    Re: ImageGalleryPage - Error Saving Content Link to this post

    Yepp, after the the following change the error disappears...

    folder = Folder::findOrMake('imagesets/' . $this->URLSegment);
    $folder->Title = $this->Title;
    // $folder->setName($this->Title);
    $folder->setName($this->URLSegment);
    $folder->write();

    Regards

  • Monty
    Avatar
    Community Member
    19 Posts

    Re: ImageGalleryPage - Error Saving Content Link to this post

    I had these same problems, but found if I deleted the ImageGallery tables in the DB and then did a dev/build/?flush=1 and then tried to add a new gallery all was fine.

  • silverseba
    Avatar
    Community Member
    26 Posts

    Re: ImageGalleryPage - Error Saving Content Link to this post

    I had similar problems: When creating or renaming a ImageGalleryPage, multiple Folders in "Files&Images" were created, and saving the page resulted in an error (Error 500: error renaming folder / folder does not exist).

    I solved this issue with 2 steps:

    1. I added proper rights (777) recursively to the 'image-gallery' folder
    2. I added a patch to image_gallery/code/ImageGalleryPage.php, that solved issues of creating multiple folders with wrong names (which resulted in the above errors when Silverstripe was trying to rename folders that didn´t exist)

    I forked the code on GitHub, so you can get the fixed PHP-file from there:
    https://github.com/sebastiand/ImageGallery/commit/280a90b2312641968d780b96a36add570b5080a4

    @UncleCheese: would you please add the fix to the master release of ImageGallery
    I also added a onBeforeDelete() function which properly clears up all Albums and the RootFolder

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: ImageGalleryPage - Error Saving Content Link to this post

    Mine was fixed by upgrading the DOM to : DataObjectManager-master-HEAD

    http://www.silverstripe.org/assets/modules/master/DataObjectManager-master-HEAD.tar.gz

    I no longer get the save error, I also changed the file permissions.

  • janulka
    Avatar
    Community Member
    80 Posts

    Re: ImageGalleryPage - Error Saving Content Link to this post

    This is what I am doing when I get "error saving content":

    1. I create new ImageGalleryPage, name it something "My Test Page"
    2. Delete the page from Silverstripe
    3. Create new ImageGalleryPage and trying to name it "My Test Page" again

    only when I manually clear everything with reference to "My Test Page" from DB (previous versions I guess, folders related to image gallery) then I can create "My Test Page" again..

  • janulka
    Avatar
    Community Member
    80 Posts

    Re: ImageGalleryPage - Error Saving Content Link to this post

    But hey, after I tried the patch silverseba posted link to (https://github.com/sebastiand/ImageGallery/commit/280a90b2312641968d780b96a36add570b5080a4), this seems to be fixed, lovely, thank you!!

    9161 Views
Page: 1 2 3 4 5 6 7
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.