Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Import from an existing folder - not working?

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 1846 Views
  • pinkp
    Avatar
    Community Member
    168 Posts

    Import from an existing folder - not working? Link to this post

    After clicking on a folder in the drop down list of "Import from an existing folder" nothing happens.... any ideas why?

    I already uploaded everything to a folder and want to move it for the ImageGallery if I just drag and drop the files to the album folders they don't show up in the "Photos" tab of the module so I thought this would be the best way rather than uploading them all again to the specific album. But no luck...

    -Thanks

  • UncleCheese
    Avatar
    4085 Posts

    Re: Import from an existing folder - not working? Link to this post

    You should get a spinning wheel while it fetches the files in that folder. Can you replicate the issue on the demo site?

    http://dataobjectmanager.carlinowebdesign.com

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: Import from an existing folder - not working? Link to this post

    Hi Uncle Cheese,

    Similar problem on SS2.3.7, using DOM2.3 (the zip downloaded via this forum).

    When clicking on 'Add photo' button and then on 'Import from an existing folder' -> Select uploads -> Uploads (9 files). I can see the spinner for a moment, but then, nothing comes up...

    <?php

    class Photo extends DataObject
    {
       static $db = array (
    'Title' => 'Text'
       );

       static $has_one = array (
    'Image' => 'Image',
          'Page' => 'Page'
       );

       public function getCMSFields_forPopup()
       {
          return new FieldSet(
             new ImageField('Image'),
    new TextField('Title')
          );
       }

    }

    class Photo_Controller extends ContentController {
       
    }

    ?>

    $idom = new ImageDataObjectManager(
             $this, // Controller
             'Photos', // Source name
             'Photo', // Source class
             'Image',
             array(), // Headings
             'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
          );
          $fields->addFieldToTab('Root.Content.Photos', $idom);

  • UncleCheese
    Avatar
    4085 Posts

    Re: Import from an existing folder - not working? Link to this post

    Can you check Firebug for the error it's throwing and post it up here?

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: Import from an existing folder - not working? Link to this post

    All I can see is this:

    POST http://localhost:8888/website.nl/www/admin/EditForm/field/Photos/import/1 500 Internal Server Error      611ms   jquery.js (line 2806)
    ParamsHeadersPostPutResponseCacheHTML
    Response Headersview source
    Date   Fri, 07 May 2010 18:21:36 GMT
    Server   Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2
    X-Powered-By   PHP/5.2.6
    Expires   Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control   no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma   no-cache
    Set-Cookie   PastMember=1; expires=Thu, 05-Aug-2010 18:21:36 GMT; path=/website.nl/www/
    Content-Length   0
    Connection   close
    Content-Type   text/html; charset="utf-8"
    Request Headersview source
    Host   localhost:8888
    User-Agent   Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9
    Accept   text/html, */*
    Accept-Language   en-us,en;q=0.5
    Accept-Encoding   gzip,deflate
    Accept-Charset   ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive   300
    Connection   keep-alive
    X-Requested-With   XMLHttpRequest
    Referer   http://localhost:8888/website.nl/www/admin/EditForm/field/Photos/upload
    Content-Length   0
    Content-Type   text/plain; charset=UTF-8
    Cookie   PastMember=1; PHPSESSID=10f3e7a577dddc5b0988b8f955acea7a

  • UncleCheese
    Avatar
    4085 Posts

    Re: Import from an existing folder - not working? Link to this post

    Make sure error reporting is turned on in your PHP configuration so it gives you a readable error rather than a generic 500.

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: Import from an existing folder - not working? Link to this post

    Ah thanks, sorry. Error is very familiar: Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 3922 bytes) in /Users/Menno/Sites/beursvanberlage.nl/www/sapphire/filesystem/GD.php on line 22

    I think I know what this is. An image with resolution > 2000 (in this case 2573px width). [url=See http://www.silverstripe.org/all-other-modules/show/276260?start=8]See [url]http://www.silverstripe.org/all-other-modules/show/276260?start=8. Please note that I agree with you that a 8000px wide image is not acceptable. However, 2500px... Is there a way to prevent this from happening? Many, many thanks in advance!

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: Import from an existing folder - not working? Link to this post

    UncleCheese, could you give my any direction (sorry, designer, learning every day), where I can create something like this:

    If (after upload) GD finds that dimensions of uploaded image are > 2000 pixels, then cancel further processing (remove image) and show user message (sorry, please upload smaller image)...

    1846 Views
Page: 1 2
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.