As a result of

$parent->subject =  truncate_utf8(decode_entities(strip_tags(check_markup($parent->title, edit['format']))), 29, TRUE);
          $edit['subject'] = t('Re: ') . $parent->subject;
        }
        db_query("UPDATE {comments} SET subject = '%s' WHERE cid = %d", $parent->subject, $edit['cid']);

in lines from 265, the comment subject is trimmed to 32 (29 + 'Re: ') characters, while the field size is 64. It should be changed to 61. It is also sent to the lists after trimming, messing up the thread subjects.

Comments

sognus’s picture

In fact, the current 29 makes no sense to me, since "Re: " + 29 = 33. It should be 60, not 61.

cor3huis’s picture

Version: 6.x-1.0 » master
cor3huis’s picture

Bump, does someone have a theoretical explanation why the choice is on 32? My first thought was along the lines of maybe has to do with multibyte but does not seem logical to me.

Then re-read the whole comments on #768040: truncate_utf8() only works for latin languages (and drupal_substr has a bug) no hints. IMHO If the fieldlength is involved it should get this maxfieldlength dynamically. And also use a t(...) return length to subtract into consideration.

philipnet’s picture

Hi,

It's probably a hangover from earlier Drupal versions.
In Drupal 6, the limit on the node title length is 255 characters.

I've committed a fix for this, which will be in the next -dev release.

cor3huis’s picture

Status: Active » Needs review
cor3huis’s picture

Status: Needs review » Reviewed & tested by the community

Tested and subject much longer than 32 did not get trimmed anymore to this.

Note, It would be good that this length still could be set in the admin page of listhandler with a minimum of 10 and as default the maxlength of 255.

For thread reconstructing if there is no matching message ID and the subject is used we however must make sure this is done before the trimming to shortlength occurs.

riteshsarraf’s picture

Hello Phillip,

Your current tar (the -dev revision) archive on the download page does not include this fix. I'm forced to use the -dev version because of another bug in listhandler related to comment being tagged for moderation. I see that you committed the fix on 8th April. I can cherry-pick the fix and use it but it looks big. I'd appreciate if you create a new tarball and update the download page.