Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Bug Reports

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 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: 47808 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: Bug Reports Link to this post

    Have you confirmed that mod_security is not running?

  • dospuntocero
    Avatar
    Community Member
    54 Posts

    Re: Bug Reports Link to this post

    Hi Uncle, i have a weird problem with ImageDataObjectManager, i cant import images from folders:

    this is my code...

          $Ads = new ImageDataObjectManager(
           $this,
           'InteractionBanners',
           'InteractionBanner',
             'InteractionBtn',
           array(
                'LinkText' => 'LinkText',
                'Link' => 'Link'
           ),
           'getCMSFields_forPopup'
          );
          
          $Ads->setPageSize(100);
          $f->addFieldToTab( 'Root.Content.InteractionBanners', $Ads );

    i dont understand what is missing, but if i upload a new file this file all works ok.

  • Howard
    Avatar
    Community Member
    215 Posts

    Re: Bug Reports Link to this post

    Yea you were right it was just a mod_security problem - I shoulda thought about that!

    Thanks

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bug Reports Link to this post

    File types that are not in the allowedFileTypes array will get greyed out. In ImageDOM, I believe that defaults to gif, jpg, and png. You can always set it manually with setAllowedFileTypes().

  • dospuntocero
    Avatar
    Community Member
    54 Posts

    Re: Bug Reports Link to this post

    thanks for the quick response

    i have tried this:

          $Ads = new ImageDataObjectManager(
           $this,
           'InteractionBanners',
           'InteractionBanner',
             'InteractionBtn',
           array(
                'LinkText' => 'LinkText',
                'Link' => 'Link'
           ),
           'getCMSFields_forPopup'
          );
          $Ads->setAllowedFileTypes(array('jpg','png','gif'));

    but i think thats not the way it works.. can you provide an example?

    when i have added that i get a blank screen with the following error:

    ImageDataObjectManager::setAllowedFileTypes() -- Only files of type jpg, jpeg are allowed.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bug Reports Link to this post

    Yeah, that's right. I excluded png because at the time Silverstripe couldn't resample PNG in its GD class. I'll update the code to allow PNG. For now, just add it to the $limitFileTypes array in ImageDOM.

  • dospuntocero
    Avatar
    Community Member
    54 Posts

    Re: Bug Reports Link to this post

    thanks!
    by the way, it seems that silverstripe now can resample pngs correctly.. i have modified your class some moments ago and with pngs works, but not with transparent gifs (transparency renders black) and both are correctly resized

  • keeny
    Avatar
    Community Member
    48 Posts

    Re: Bug Reports Link to this post

    Hi all,

    I'm having an issue where if I upload an image in 'Files & Images' to a subfolder, the files go straight into the root of the assets folder and not into the folder I want them to.

    Any ideas?

    Cheers,

    Barry.

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