Using PHP version 5.6.

For notices I have updated line no. 176 with isset condition.

          if (isset($variables['element']['#formatter']) && $variables['element']['#formatter'] == 'date_default') {

I was not getting the value of the date.
line no. 193

$date = format_date(strtotime($variables['element']['#object']->$field_name['und'][0]['value']), 'custom', 'm/d/Y g:ia');

When I updated the code.

$date = format_date(strtotime($variables['element']['#object']->{$field_name}['und'][0]['value']), 'custom', 'm/d/Y g:ia');

It worked perfectly.

Again, I placed token inside the formatter for date field but they were not getting replaced. When I updated the the line no. 215 it worked fine.

$class_value = token_replace($settings[$value]['tokenized'], array('node' => $variables['element']['#object']));
CommentFileSizeAuthor
#2 2932980-1.patch2.17 KBpradeep22saini

Comments

pradeep22saini created an issue. See original summary.

pradeep22saini’s picture

Status: Active » Needs review
StatusFileSize
new2.17 KB

Updating the patch for issue faced and resolved.

scuba_fly’s picture

Version: 7.x-1.0 » 7.x-2.x-dev

I did a code review. Patch makes sense and code looks good. Thanks!

I did not try to apply the patch.

Since 7.x-2.0 is being developed, maybe anyone could try and see if this patch applies there?