Download & Extend

karma error when editing node

Project:Karma
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I've got karma set up so users can rate comments, but not nodes. Comment ratings are visible to everyone.

When a goes to edit a node (e.g. node/182/edit) the site generates an error:
: Object of class stdClass could not be converted to string in /var/www/drupal/sites/all/modules/karma/karma.module on line 519.

I tried to fix it myself, but my PHP/MySQL skills are fairly limited and the Drupal API is new to me.

I'm using Drupal 5.1. I haven't tried 5.2 yet.

Jeremy McNaughton

Comments

#1

It's a syntax issue in PHP 5.2.

This line:

$forms['karma_rating_form_'. $type .'_'. $id] = array( 'callback' => 'karma_rating_form', $type, $object);

doesn't look quite right to me, especially the 'karma_rating_form_'. $type .'_'. $id part.

Does anyone have any idea as to how to fix this?

#2

Status:active» fixed

Fixed. It wasn't intelligently checking for $form_id in hook_forms to apply the form builder only to the 'karma_rating_form'.

Will be in tonight's build.

#3

Status:fixed» closed (fixed)
nobody click here