I'm getting two php warnings when I use this module:

# notice: Undefined index: operation in /Applications/MAMP/htdocs/drupal6/sites/all/modules/activity/activity.module on line 1433.
# notice: Undefined variable: info in /Applications/MAMP/htdocs/drupal6/sites/all/modules/activity/views-view-row-activity.tpl.php on line 12.

The attached patch fixes these.

Cheers,
Stella

Comments

stella’s picture

StatusFileSize
new2.63 KB
sirkitree’s picture

Status: Needs review » Fixed

thank you, committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Status: Closed (fixed) » Active

This patch introduced a big problem. If there's no 'mark' then the activity message is never displayed.

  * Theme function for individual activity message.
  */
 function theme_activity($message, $item) {
-  $output = $item['mark'] .'<span class="activity activity-module-'. $item['module'] .' activity-type-'. $item['type'] .' activity-operation-'. $item['operation'] .'">'. $message .'</span>';
+  $output = '';
+  if (isset($item['mark'])) {
+    $output = $item['mark'] .'<span class="activity activity-module-'. $item['module'] .' activity-type-'. $item['type'] .' activity-operation-'. $item['operation'] .'">'. $message .'</span>';
+  }
   $output .= '<span class="activity-links">';
 
   // If user has permission to create an activity comment then show link to add comment

See what I mean?

drewish’s picture

Status: Active » Needs review

yeah i think that something like this would be better:

  $output = '';
  if (isset($item['mark'])) {
    $output .= $item['mark'];
  }
  $output .= '<span class="activity activity-module-'. $item['module'] .' activity-type-'. $item['type'] .' activity-operation-'. $item['operation'] .'">'. $message .'</span>';

or

  $item += array('mark' => '');
  $output = $output = $item['mark'] .'<span class="activity activity-module-'. $item['module'] .' activity-type-'. $item['type'] .' activity-operation-'. $item['operation'] .'">'. $message .'</span>';
Anonymous’s picture

It's a theme function, so I think the most "basic" syntax and expression is preferred so themers can comprehend the goings on without a headache. For me, that means the first option. I don't understand the second one myself.

I'm at Drupalcon now, but I can roll a patch in a few days if nobody else does.

sirkitree’s picture

Status: Needs review » Closed (won't fix)

closing. 1.x no longer supported.