Closed (fixed)
Project:
Re: Comment subjects
Version:
5.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
30 Aug 2008 at 21:03 UTC
Updated:
20 Nov 2008 at 09:02 UTC
Jump to comment: Most recent file
minor bug to report! The error about happenes if you are trying to leave a comment for a node that has a title more than 64 characters.
It is a little bit confusing for users leaving comments. I suggested fix is to allow the module to automatically trip any characters that are passed the 64 character limit on the comment subject.
You can test the following bug at the following URL http://www.compshack.com/forum/peoplesoft/peoplesoft-technical/strange-i...
Please let me know what you think?
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | subject_truncate.patch | 884 bytes | ahoeben |
Comments
Comment #1
ahoeben commentedThanks, I'll look in to this.
Comment #2
sgdev commentedI'm having the same problems on my site. I've had several users tell me they couldn't post comments on particular blog entries. Then I realized the reason why is the blog entries had really long titles, and therefore the default comment subject was longer than 64 characters.
No error message is presented to the user, it just returns to the page to fill out the comment again. Would be better if a really long title is truncated to be something like "Re: A really long title, a really long title, a really long title..."
Comment #3
ahoeben commentedI'm sorry, I have been busy with other things lately. A patch is fairly trivial, but I've had no time for it yet.
Comment #4
arhak commentedis this an issue of this module?
shouldn't be the comment.module which reports a validation error?
besides, this module might take care of not proposing long subject, but I think it should be truncated by comment.module, or at least reported as a validation error so this module would have to check for it first.
Comment #5
ahoeben commentedYes, it's an issue of this module. The subject title is generated programmatically, and the created value can not always be used as is. The module should be smarter than that.
Attached is a patch, that needs some testing before I create new packages (for 4.7.x, 5.x and 6.x).
Comment #6
ahoeben commentedComment #7
arhak commentedwell, yeah, this module should truncate, but.. doesn't have comment module to complain about validation?
I'm asking if there is also a flaw on comment module?
Comment #8
jaydub commentedWorks in testing for me.
Comment #9
jaydub commentedHave to make a small adjustment to account for the ' ...' dots added as
a result of the 4th parameter to the truncate_utf8() call
should be
alternatively you can drop the use of the ' ...' dots and set back to 64
Comment #10
ahoeben commentedtruncate_utf8 takes care of that automatically:
http://api.drupal.org/api/function/truncate_utf8
Comment #11
jaydub commentedThat's not true in the d5 version of truncate_utf8() although is the case in d6+
After applying the patch I got a further bug report from someone who hit 65 chars so I thought it might be the dots. For the sake of discussion the string was this:
Adding the prefix 'Re: ' the string is now:
When running that string through the truncate_utf8() function I get a resulting string of:
which happens to be 65 chars and thus still throws an error.
So for d5 versions, you should set the length to 60 to be safe.
Comment #12
ahoeben commentedYou are correct, thanks for testing
Comment #13
CompShack commentedWould this be committed to the d6 branch as well?
Comment #14
arhak commentedwold this have something to do with this particular bug?
line 244, unicode.incComment #15
arhak commentedwold this have something to do with this particular bug?
line 244, unicode.incComment #16
arhak commentedfor a better appreciation
unicode.incComment #17
ahoeben commentedFixed in 1.4 releases for D4.7 - D6. New release packages should appear within 24 ours.