Project:Activity
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

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

AttachmentSize
activity_undefined_msg.patch1.38 KB

Comments

#1

AttachmentSize
activity_undefined_msg.patch 2.63 KB

#2

Status:needs review» fixed

thank you, committed.

#3

Status:fixed» closed (fixed)

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

#4

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?

#5

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>';

#6

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.

#7

Status:needs review» closed (won't fix)

closing. 1.x no longer supported.

nobody click here