OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



DB Error: Data too long for column 'comment_title' at row 1

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

DB Error: Data too long for column 'comment_title' at row 1

Postby Saad Alsomihi » Fri Jan 04, 2008 3:39 pm

The following message
////////////
DB Error: Data too long for column 'comment_title' at row 1
//////////////
Arises when the reviewer trying to insert comment on article.

So I tried to know the reason behind it, and discovered that the size of the field for the name of article in ojs database is 255 characters but for comment title field is 90 characters only

So my solution is to increase the size for field
'comment_title' in table article_comments to be 255 characters

Same as the field setting_name in table article_settings

Is the solution to the problem which I have done is acceptable or that there problems behind him

Please assist in this.
And clarify whether this is a problem in the system or not

Saad alsomihi
Saad Alsomihi
 
Posts: 1
Joined: Fri Jan 04, 2008 1:13 pm

Re: DB Error: Data too long for column 'comment_title' at row 1

Postby asmecher » Mon Jan 07, 2008 10:36 am

Hi Saad,

To increase the maximum length of that field, you'll need to change it in two places:
  • The dbscripts/xml/ojs_schema.xml descriptor, as you've done
  • The live database, by executing:
    Code: Select all
    ALTER TABLE article_comments CHANGE comment_title comment_title VARCHAR(255) NOT NULL;
Whenever you upgrade to a newer release, please make sure that this change is kept in the descriptor before running the upgrade script, or you may truncate your comments.

The reason this is happening is probably that you're not using UTF-8 support in your database (as configured in config.inc.php). This causes mismatches in the lengths of strings containing accents and other special characters, depending on whether you ask PHP or MySQL for the length of that string. If possible, I'd suggest enabling UTF-8 support.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests