Nice module first of all! Just what I need for my site. Now a bug report...

My site is in Russian so are the frequently asked questions. I began entering questions and then I went to the Weight tab. The list displayed some questions but not others. The problem is incorrect truncation of multibyte strings in the following piece of code in faq_weight_settings_form(), which can generate invalid UTF-8 sequence:

    while ($node = db_fetch_object($result)) {
      $title = (drupal_strlen($node->title) <= 64) ? $node->title : substr_replace($node->title, "...", 63);
      $options[$node->nid] = $title;
      $order .= "$node->nid,";
    }
    $order = rtrim($order, ",");

To fix the problem, the following line:
$title = (drupal_strlen($node->title) <= 64) ? $node->title : substr_replace($node->title, "...", 63);
should be replaced with something like:
$title = (drupal_strlen($node->title) <= 64) ? $node->title : drupal_substr($node->title, 0, 63) . "...";

Comments

andyceo’s picture

Subscribing. We have the same error! Please, commit this issue.

andyceo’s picture

Version: 5.x-2.12 » 6.x-1.8

But we have another version of this module.

stella’s picture

Status: Active » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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

stella’s picture

Released in faq 6.x-1.9 and 5.x-2.13.