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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

[Solved] Image Thumbnails in Gridfield


Go to End


24 Posts   15354 Views

Avatar
tmkp

Community Member, 42 Posts

29 June 2012 at 1:25am

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

Avatar
tmkp

Community Member, 42 Posts

29 June 2012 at 1:55am

Edited: 29/06/2012 1:58am

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 here that was closed 16 months ago.

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

Avatar
martimiz

Forum Moderator, 1391 Posts

29 June 2012 at 4:33am

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

Community Member, 30 Posts

29 June 2012 at 12:16pm

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

Community Member, 42 Posts

29 June 2012 at 9:49pm

Edited: 29/06/2012 9:58pm

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

Edit: http://open.silverstripe.org/ticket/7590

Avatar
martimiz

Forum Moderator, 1391 Posts

30 June 2012 at 2:36am

Edited: 30/06/2012 2:37am

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

Community Member, 30 Posts

30 June 2012 at 3:26am

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

Community Member, 136 Posts

4 July 2012 at 10:11pm

Any updates on this from the hackathon?