mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
bfojcapell: Fixed php notice
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42150 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3d7e381341
commit
9d32d9518f
@ -372,12 +372,14 @@ HTML;
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
list ($field, $caster) = explode("->", $field);
|
||||
$fieldParts = explode("->", $field);
|
||||
$field = $fieldParts[0];
|
||||
if(preg_match('/^(.+)\.(.+)$/', $field, $matches)) {
|
||||
$field = $matches[2];
|
||||
}
|
||||
|
||||
if($caster) {
|
||||
if(isset($fieldParts[1])) {
|
||||
$caster = $fieldParts[1];
|
||||
// When the intending value is Created.Date, the obj need to be casted as Datetime explicitely.
|
||||
if ($field == "Created" || $field == "LastEdited") {
|
||||
$created = Object::create('Datetime', $result->Created, "Created");
|
||||
|
Loading…
Reference in New Issue
Block a user