silverstripe/silverstripe-framework — pull request #2021 by jthomerson (2013-05-27 21:07:14+00:00)
Title: FIX: <% if Link %> wasn't working

Since ViewableData was returning a casting helper for Link, but DataObject was
only using $this->$fieldname to set values on that casting helper, you could
not use <% if Link %> (or <% if $Link %>) in your templates because Link is not
a field, and thus had no value to be set on the casting helper, causing
hasValue to think that there was no value. Since DataObject->dbOject says that
"it only matches fields and not methods", it seems safe to have it pass an
argument to ViewableData->castingHelper requiring it to do the same - only
return casting helpers for actual DB fields and not other things in the casting
config.