Posted by stella on June 3, 2009 at 6:09pm
| 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
| Attachment | Size |
|---|---|
| activity_undefined_msg.patch | 1.38 KB |
Comments
#1
#2
thank you, committed.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.
#4
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
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
closing. 1.x no longer supported.