Hi,

I am using Drupal 6.20 and the module does not seem to function. I followed the instructions and have created a Kudos called "Good Topic" and assigned it to forum topics and comments. A button appears in forum topics, but when clicked nothing happens. The Drupal log reports:

trim() expects parameter 1 to be string, array given in sites\all\modules\kudos\kudos.module on line 591.

In addition, no user menus or views have been created that display kudos'.

I appreciate any assistance you can provide.

Thanks,

Shane.

Comments

reikiman’s picture

I'm getting the same error message.

Inspecting the code I see:

function kudos_form(&$form_state, $content_type, $content_id, $widget_style = array(), $misc = array()) {
....
  if (!isset($misc['style']) && trim($widget_style) !== "") {  // line 591
...

Clearly widget_style can be an array, and clearly trim(Array) makes no sense. The code is simply wrong.

JohnnyW’s picture

Any luck on fixing this??

Please help.

benanne’s picture

Is this module still being maintained? I'm encountering the same problem. If not, I will have to look for an alternative.

Dewi Morgan’s picture

Changing that line to:
if (!isset($misc['style']) && !empty($widget_style)) {
seems to fix at least the symptom, so the module works.

As for the root cause, the comment above that line says that this is "backwards compatibility" code. There's expected to be a style configured in $misc['style'], and there isn't, so it falls back to trying $widget_style, which in my case at least seems to be an array of arrays. Where these variables come from, and why $misc['style'] might not be set, I don't know and will leave to those more steeped in Drupal than I.