Jump to:

23453 Posts in 18902 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Selecting Image Folder gives "Error getting files"?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1 2 3
Go to End
Author Topic: 4760 Views
  • RichardMortimer
    Avatar
    Community Member
    15 Posts

    Selecting Image Folder gives "Error getting files"? Link to this post

    Hi,

    We have had SS2.3.3 installed for some time now, and the lady who edits the content called me this morning with this error. Whenever she selects to insert an image, and then selects the folder she has the image in, the CMS gives an error "Error getting files" directly underneath the editing pane; in red, with an exclamation mark. She cannot see any images and can't insert anything.

    I can reproduce this error, but can't see any reason why it is happening, there are no errors in the apache log files (either the normal log or the error log).

    I've checked file permissions (we're running WAMP), and all users on this machine have access to this folder.

    I've tried removing the _resampled directory as was suggested elsewhere on this forum, but this didn't solve the issue.

    A couple of days ago, this was working fine, there have been no changes external to the CMS that I am aware of (eg no JS/Template/CSS changes), and I'm at a loss to explain or even diagnose this problem.

    Anyone have any suggestions/ideas?

    Thanks

    Richard

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Selecting Image Folder gives "Error getting files"? Link to this post

    DEFINITELY get yourself Firebug (you are using firefox, right?) and turn on all panels. Then replicate the error and watch the Net > XHR tab. This will dump the content/headers from the AJAX request for your debugging pleasure.

    http://getfirebug.com/

  • RichardMortimer
    Avatar
    Community Member
    15 Posts

    Re: Selecting Image Folder gives "Error getting files"? Link to this post

    Thanks for that - I get this error:

    GET ImageForm?action_callfieldmethod=1&fieldName=Image&ajax=1&methodName=getimages&folderID=150&searchText=undefined&cacheKillerDate=1254355002072&cacheKillerRand=2865
    http://XXX.XXX.XXX.XXX/admin/EditorToolbar/ImageForm?action_callfieldmethod=1&fieldName=Image&ajax=1&methodName=getimages&folderID=150&searchText=undefined&cacheKillerDate=1254355002072&cacheKillerRand=2865

    500 Warning: "Parameter 1 to Hierarchy::loadDescendantIDListInto() expected to be a reference, value given" at line 525 of C:\wamp\www\sapphire\core\Object.php

    I changed our IP address to XXX, etc. I'm going to start having a poke around, but if anyone has any other clues, they would be appreciated.

    Cheers

    Richard

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Selecting Image Folder gives "Error getting files"? Link to this post

    Ah hah! This is PHP 5.3's stricter handling of objects-by-reference. The offending code is below, your options are:

    1. This is a bug for 5.3 compatibility, you should log it in http://open.silverstripe.com

    2a. You may be able to bypass it by reducing your Error Reporting to E_ERROR
    -or-
    2b. Downgrade to 5.2.9, the folks over at Joomla have written up a nice WAMP instruction guide:
    http://forum.joomla.org/viewtopic.php?p=1871648#p1871648

    The following is called by the ThumbnailStripField used in the CMS for Image Insertion.

    /sapphire/core/model/Hierarchy.php Line 340

       public function getDescendantIDList() {
          $idList = array();
          $this->loadDescendantIDListInto($idList);
          return $idList;
       }
       
       /**
        * Get a list of this DataObject's and all it's descendants ID, and put it in $idList.
        * @var array $idList Array to put results in.
        */
       public function loadDescendantIDListInto(&$idList) {
          if($children = $this->AllChildren()) {
             foreach($children as $child) {
                if(in_array($child->ID, $idList)) {
                   continue;
                }
                $idList[] = $child->ID;
                $child->loadDescendantIDListInto($idList);
             }
          }
       }

  • RichardMortimer
    Avatar
    Community Member
    15 Posts

    Re: Selecting Image Folder gives "Error getting files"? Link to this post

    Thanks for that - it sounds like it is a 'known' bug?

    I found late yesterday that these lines were causing the problem, located in the mysite/_config.php file:

    Director::set_environment_type("dev");
    if(Director::isLive()) Debug::send_errors_to("EMAIL_ADDRESS@LOCATION");

    (note: email address was changed to stop spam!)

    I believe somewhere a while ago, someone suggested turning this on for debugging, and, ironically, it caused this bug.

    Cheers

    Richard

  • vancouverWill
    Avatar
    Community Member
    121 Posts

    Re: Selecting Image Folder gives "Error getting files"? Link to this post

    Thanks. That was exactly the problem I was having, caused a headache for a while trying to figure it out then went to the forums and the answer was right there. Shouldn't this be a bug? The only line I had was

    Director::set_environment_type("dev");

    and this caused the "file and images" section and the image insert feature to basically be useless.

    Anyway much thanks to you guys and good old firebug.

  • RichardMortimer
    Avatar
    Community Member
    15 Posts

    Re: Selecting Image Folder gives "Error getting files"? Link to this post

    Whilst it makes the default preview fairly useless, I found the search preview still worked, so I did a search on the letter 'g', which found everything with Gif, jpG or pnG in the name - that covered most image files (and if you could remember the name of the file, that was even better!!)

    Cheers

    Richard

  • Sunnybex
    Avatar
    Community Member
    39 Posts

    Re: Selecting Image Folder gives "Error getting files"? Link to this post

    jep, downgrading to 5.2.9 definetely works, after changing the php- version via the wamp-server-icon...
    Nevertheles, this bug should be fixed.
    b.r.
    Bex

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