Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template global fixes #247

Merged
merged 3 commits into from May 19, 2012
Merged

Conversation

sminnee
Copy link
Member

@sminnee sminnee commented Mar 16, 2012

@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.

Sam Minnee added 3 commits March 16, 2012 15:05
…ntexts (e.g. $Now.Year)

BUGFIX: Allow template globals to return objects as well as values.
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.
…global provider, and use the new TemplateGlobalProvider interface on SS_Datetime instead.
@sminnee
Copy link
Member Author

sminnee commented Mar 16, 2012

Will close http://open.silverstripe.org/ticket/3943

@hafriedlander
Copy link
Contributor

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.

@sminnee
Copy link
Member Author

sminnee commented Mar 16, 2012

I might rename the method to something else. I'll add a test for the edge case you suggest.

@chillu
Copy link
Member

chillu commented Apr 10, 2012

@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?

@chillu
Copy link
Member

chillu commented Apr 18, 2012

@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 :)

@hafriedlander
Copy link
Contributor

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.

@halkyon
Copy link
Contributor

halkyon commented May 11, 2012

It'd be great to get this in before beta3.

@halkyon halkyon merged commit 8bbfa97 into silverstripe:master May 19, 2012
bergice pushed a commit to open-sausages/silverstripe-framework that referenced this pull request Nov 18, 2018
…ined-to-the-wrong-type

Fix incorrect data type obtained sometimes through html dataset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants