@hafriedlander - this is one for you to review. The TemplateGlobalProvider didn't let you create objects. I have attempted to solve that it and it both seems to work and passes the tests, but should probably still review it.
It means that we can make $Now a template global, and still have $Now.Year work.
BUGFIX: Allow template globals to be used in both object and value co…
…ntexts (e.g. $Now.Year)
BUGFIX: Allow template globals to return objects as well as values.
API CHANGE: Rename 'PastMember' to 'IsRepeatMember' in templates.
API CHANGE: Move Controller::PastMember() to Member::is_repeat_member() in code.
API CHANGE: Removed Controller::CurrentMember(), it was only ever intended as a template global provider.
API CHANGE: Remove Controller::Now(), as it was only ever a template …
…global provider, and use the new TemplateGlobalProvider interface on SS_Datetime instead.
Will close http://open.silverstripe.org/ticket/3943
I'm sneaking in here and got immediately confused about the name. Throwing some suggestions out here to satisfy my inner demons.
"Has previously logged in" is probably the one that is most accurate. It's verbose, but it's also a bit of an edge-case feature, so maybe that's okay?
Most likely. After three years with SS; I never used that call. ;)
Hmm. Looks ok. Don't really like "getObj" as a name, but can't think of something better, given the copy-pasta needed to make _DataPresenter override obj itself. Only thing to check is that if a DataObject has a getObj method then $Obj works - I think it should, but best to check.
I might rename the method to something else. I'll add a test for the edge case you suggest.
@sminnee Can you try to get those tests written (and the method renamed) this week so we can still get this pull request into beta2?
@sminnee @hafriedlander Are you OK with merging this in without tests? Unless Sam can write them in the next ~10h I don't see how that'd get into beta2 :)
Umm. It looks OK? It need rechecking against the changes I made last week re: passing arguments into includes to make sure tests still pass.
It'd be great to get this in before beta3.
Merge branch (pull request #247) 'template-global-fixes' of https://g…
…ithub.com/sminnee/sapphire into sminnee-template-global-fixes