View more context

 

theruss

@Nik Have a look at ViewableData::__get() 🙂

Nik

Looks good, although I don't get how summary_fields resolves a method without a getMethod? An entry named SomeMethod will work, even without having a getSomeMethod function, but just a SomeMethod function. How? Follow up would be how dot notation is being parsed, although for that I found GridFieldDataColumns.getValueFromRelation - not sure if it's the correct one

Nik

Thanks for your help with this 🙂

theruss

AFAIK $summary_fields will resolve methods without a "get" prefix, only if they're declared either as first-class, class-properties or through having been declared as a "Field" (which silverstripe defines as being a field in $db or in $has_one)

theruss

You can test this by declaring a randomly method Wibble() that returns the string "Pencils up nose" (Blackadder episode...) and calling it from $summary_fields.

theruss

If that works, and your GridField displays a column each of who's cells shows "Pencils up nose", then I couldn't tell you what sorcery was doing that...

Nik

So I have a method called Preview that is mapped to in summary_fields - it's literally just a method, and it returns a DBText. And that works - which I couldn't figure out

jakx

I got no puns for that sadly @gs 😅, best I got it "sounds like you're stuck between a block and an application/hard place". Sorry to let you down.

Also, adding new modules can take a bit of juggling, but you'll find a sweet spot after a bit of review. Good luck!

gs

thanks @jakx yeah I'm juggling between silverstripe-elemental and silverstripe/userforms which each says the other is not supported. Trying to update both modules together

jakx

My current project has both, including the dnadesign/silverstripe-elemental-userforms module. If that's any re-assurance @gs

gs

cool thanks @jakx just updated both modules and testing it out

🙌 (1)
John Lombardo

Can GroupedLists only be used with DataObjects? I have an ArrayList from an API I am consuming and it looks like GroupedList relies on a custom method on a DataObject.

John Lombardo

I want to group the ArrayList using a the date key on all of the ArrayData elements in the list

Isaac

Hi, is there a way to make sake execute as www-data user rather than root? I’ve googled it with zero success 😐

jakx

Does something like sudo -H -u www-data bash -c 'vendor/bin/sake' work @Isaac?

Isaac

thanks i’ll give that a shot and report back