Would someone be able to explain how SilverStripe distinguishes between a field and a method when specifying things like summary fields? It works fine, I'm just curious about the under-the-hood implementation. I've had a look through the code, but seems like I'm missing some parts there.
I haven’t been following what you are trying to achieve but that error is telling you that it can’t find the class that you are trying to extend from. You’ll need to add:
- use SilverStripe\CMS\Model\VirtualPage;
@jakx I'm trying to install silverstripe-mimevalidator,
It's throwing a conflict on both dnadesign/silverstripe-elemental and silverstripe/userforms
@Nik Have a look at
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
$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
You can test this by declaring a randomly method
Wibble() that returns the string "Pencils up nose" (Blackadder episode...) and calling it from
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...
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!
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
My current project has both, including the
dnadesign/silverstripe-elemental-userforms module. If that's any re-assurance @gs
cool thanks @jakx just updated both modules and testing it out
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.