21309 Posts in 5738 Topics by 2603 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, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1511 Views |
-
No images found in (uploadfolder) after successfull upload

13 July 2009 at 2:16pm Last edited: 13 July 2009 2:17pm
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?
-
Re: No images found in (uploadfolder) after successfull upload

13 July 2009 at 3:03pm
Just to be complete: No error whatsoever in the Apache error log
-
Re: No images found in (uploadfolder) after successfull upload

13 July 2009 at 7:09pm
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 ?
-
Re: No images found in (uploadfolder) after successfull upload

13 July 2009 at 8:26pm
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 ?
-
Re: No images found in (uploadfolder) after successfull upload

13 July 2009 at 11:12pm
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? -
Re: No images found in (uploadfolder) after successfull upload

14 July 2009 at 1:46am
Is /sapphire/filesystem/Folder.php overwritten somewhere?
I changed a few things, to debug this, but the changes seem not to get executed. -
Re: No images found in (uploadfolder) after successfull upload

14 July 2009 at 2:40am
Yeah, that was it, it seems to be handled by the Data Objects manager, see this post and Cheeseuncles answers
-
Re: No images found in (uploadfolder) after successfull upload

14 July 2009 at 6:27am
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
| 1511 Views | ||
|
Page:
1
|
Go to Top |

