karma error when editing node

jmcnaught - September 11, 2007 - 05:47
Project:Karma
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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

#1

bardkerbie - October 13, 2007 - 22:49

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

mcarbone - October 19, 2007 - 00:13
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

Anonymous - November 2, 2007 - 00:21
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.