Jump to:

22975 Posts in 11620 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » No images found in (uploadfolder) after successfull upload

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
Go to End
Author Topic: 1647 Views
  • Kalileo
    Avatar
    Community Member
    127 Posts

    No images found in (uploadfolder) after successfull upload Link to this post

    New install of 2.3.2, I can upload images and files without problems. In Files & Images they are all shown. So far so good.

    However in admin when I want to insert them in the content of a page, the only image which is shown is the Silverstripe logo in the Uploads folder. Also that is the only image having its thumbnail created there in the _resampled subdirectory.

    I created a new folder in assets, called Pages, and uploaded plenty of images there. they are all there, and i can manually insert them in the content by specifying their path such as img src="assets/Pages/my-image-01.jpg, all images display fine. (Of course that is not a solution for the customer.) However in admin it only shows "No images found in Pages"

    The webserver user and group have write rights to the assets folder, as said uploading itself works fine.

    Possibly this is the same issue reported also here Insert Image Files not updating

    Any hints anyone?

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: No images found in (uploadfolder) after successfull upload Link to this post

    Just to be complete: No error whatsoever in the Apache error log

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: No images found in (uploadfolder) after successfull upload Link to this post

    Sniffing through the code I see that in ThumbnailStripField.php the images in a folder are searched with

    $whereSQL = 'ParentID IN (' . implode(', ', $folderList) . ')';
    $images = DataObject::get('Image', $whereSQL, 'Title');

    which finds the SS logo, but not the other images.

    The table File contains all images, but they are all having the enum Field ClassName set to File, and only the SS logo has it setto Image. That seems to be the reason why they are not recognized in admin as images.

    Next question is why are they not having all ClassName = Image ?

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: No images found in (uploadfolder) after successfull upload Link to this post

    Manually changing the ClassName to Image does indeed make the pictures appear in admin, now they can be inserted into the content there.

    Still the question is why are they not having all ClassName = Image ?

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: No images found in (uploadfolder) after successfull upload Link to this post

    Saphhire's Folder.php function constructChild($name) should set className = Image depending on the extension.

    Line 142:

    142: $ext = strtolower(substr($name,strrpos($name,'.')+1));
    143: switch($ext) {
    144: case "gif": case "jpg": case "jpeg": case "png": $className = "Image";


    $name is set with basename($file).
    Why did that not work?

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: No images found in (uploadfolder) after successfull upload Link to this post

    Is /sapphire/filesystem/Folder.php overwritten somewhere?
    I changed a few things, to debug this, but the changes seem not to get executed.

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: No images found in (uploadfolder) after successfull upload Link to this post

    Yeah, that was it, it seems to be handled by the Data Objects manager, see this post and Cheeseuncles answers

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: No images found in (uploadfolder) after successfull upload Link to this post

    The fix for the No images found problem is here.

    Summary:

    Update dataobject_manager to at least revision 210, currently that is trunk.

    That checks out revision 210, which indeed fixes the "no images found in folder" issue

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