Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

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

[Solved] Image Thumbnails in Gridfield


Reply

23 Posts   6182 Views

Avatar
tmkp

29 June 2012 at 1:25am Community Member, 42 Posts

Done.
I was kind of happy with jak's workaround though : )

Avatar
tmkp

29 June 2012 at 1:55am (Last edited: 29 June 2012 1:58am), Community Member, 42 Posts

On a different note.. Toying around with the example I've posted above, I'm finding that every time i add a record or publish the ContactList Page I'm getting taken back to the Content tab instead of my Contact list. Click orgies are surely to ensue.

Found a corresponding ticket [url=http://open.silverstripe.org/ticket/6489]here[/url] that was closed 16 months ago.

While you're on it, can anyone reproduce this behaviour?

Avatar
martimiz

29 June 2012 at 4:33am Forum Moderator, 1091 Posts

I can now confirm that my solution no longer works on any of my installs... (on 3.0.0 stable now)

Also: I cannot see any uploaded images in the listview of the Files section. Something must have changed after v beta3 (since it worked there, tested it again just now). Looks like StripThumbnail and other functions like it just aren't called any more... :(

Avatar
UndefinedOffset

29 June 2012 at 12:16pm Community Member, 27 Posts

ya something changed in GridFieldDataColumns in RC1 it still doesn't work in 3.0 final. I've managed to diff beta 3 and final but I'm not sure why it would be broken. As far as I can see it shouldn't have worked in beta 3 it should have been entity encoded in beta 3.

Its kinda too bad that this is broken it was really nice to be able to say Image.CMSThumbnail in your summary fields and it would just work. Maybe it will get addressed in the hackathon tonight, and come in 3.0.1

Attached Files
Avatar
tmkp

29 June 2012 at 9:49pm (Last edited: 29 June 2012 9:58pm), Community Member, 42 Posts

Confirming for 3.0.0 stable. Thumbnails are broken in gridfields, including the files section. Filing a ticket now.

Edit: [url]http://open.silverstripe.org/ticket/7590[/url]

Avatar
martimiz

30 June 2012 at 2:36am (Last edited: 30 June 2012 2:37am), Forum Moderator, 1091 Posts

Looks like the problem is indeed the GridFieldDataColumns->getColumnContent() function: if you replace line 132:

$value = Convert::raw2xml($gridField->getDataFieldValue($record, $columnName));

by the beta3 version

if(strpos($columnName, '.') === false) {
   $value = $record->XML_val($columnName);
} else {
   $value = $this->getValueFromRelation($record, $columnName);
}

It works again. But obviously there is a reason for the code change. I've done some tracing to find out where it goes wrong, but I can't quite grasp the reason, so I guess we'll have to wait a bit...

Avatar
UndefinedOffset

30 June 2012 at 3:26am Community Member, 27 Posts

I'm kinda hoping that this gets fixed during the hackathon today and comes to us in 3.0.1, but we'll have to wait and see. I'd bug Ingo (chillu) about it on the channel but he's probably very busy :). At least with the ticket raised hopefully it will get seen and fixed.

Avatar
neilcreagh

4 July 2012 at 10:11pm Community Member, 94 Posts

Any updates on this from the hackathon?