OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Error uploading Galley file

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.

Error uploading Galley file

Postby nicollb » Tue Jan 30, 2007 1:12 pm

When I attempt to upload a galley I get the following error:
DB Error: Data too long for column 'keyword_text' at row 1

This does not occur for Layout files.

History: I was getting an error which I got rid of by altering the database tables to default to UTF-8;

OJS Version: 2.1.1.0
MySQL: 5.0.18
OS: Redhat ES4
nicollb
 
Posts: 15
Joined: Fri Sep 30, 2005 11:35 am

Postby asmecher » Tue Jan 30, 2007 3:37 pm

Hi nicollb,

Have you configured OJS to use UTF-8 connections to the database in config.inc.php?

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 9220
Joined: Wed Aug 10, 2005 12:56 pm

Postby nicollb » Tue Jan 30, 2007 3:42 pm

I believe so. This is the relevant section of the config.inc.php:

client_charset = utf-8

; Database connection character set
; Must be set to "Off" if not supported by the database server
; If enabled, must be the same character set as "client_charset"
; (although the actual name may differ slightly depending on the server)
connection_charset = utf8

; Database storage character set
; Must be set to "Off" if not supported by the database server
database_charset = utf8
nicollb
 
Posts: 15
Joined: Fri Sep 30, 2005 11:35 am

Postby nicollb » Tue Jan 30, 2007 3:44 pm

I forgot to include the fact that I am also php5.1.2 - if that matters.
nicollb
 
Posts: 15
Joined: Fri Sep 30, 2005 11:35 am

Postby asmecher » Tue Jan 30, 2007 4:04 pm

Hi nicollb,

I suspect your keyword table still isn't properly handling the incoming data as UTF-8. Data is inserted into the table in question in classes/search/ArticleSearchDAO.inc.php using the insertKeyword function; this is called from the ArticleSearchIndex::insertObjectKeywords function, which filters keywords and limits their length using the filterKeywords function. The default maximum length of a keyword in PHP is 40 characters (SEARCH_KEYWORD_MAX_LENGTH), or up to 80 bytes using UTF-8. The default maximum in the database is 60 characters, so if your database is configured for UTF-8, it shouldn't be possible for OJS to try to insert a keyword that is too long; however, it is possible if OJS is using UTF-8 but your database is not.

You'll have to do a little debugging -- find out what keyword is causing the trouble by enabling DBMS query logging. See how its length compares to the lengths above and try manually inserting it into the table.

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 9220
Joined: Wed Aug 10, 2005 12:56 pm

Postby nicollb » Wed Jan 31, 2007 2:28 pm

In order to find this mysterious keyword (the problem occurs with multiple, possibly all galleys) I ask - are keywords just single words with an article? Or how does that work?

are url's entered into the keyword field?
nicollb
 
Posts: 15
Joined: Fri Sep 30, 2005 11:35 am

Postby nicollb » Wed Jan 31, 2007 3:11 pm

Detective work reveals that the issue turns out to be things like "smart quotes", elipses, etc that are the result of the text being converted to html out of a word doc (we post it all in html, but it is originally done in Word).

Is there a way around this?
nicollb
 
Posts: 15
Joined: Fri Sep 30, 2005 11:35 am

Postby asmecher » Wed Jan 31, 2007 4:36 pm

Hi nicollb,

Yes, to answer your previous question, article_search_keywords is used to store an index to each word that appears in content, whether it's in the full-text of an article or its metadata.

The "smart quotes" problem is a tricky one -- we've run into it in other contexts, but not this particular context. Technically, I would say that the problem belongs to the web browser and/or operating system on the client side, as OJS uses standard methods to specify that it should receive UTF-8 compliant data and the client side is not meeting these specifications. The smart quotes are invalid characters that Microsoft has grafted onto an otherwise standard character set.

I'm hesitant to add a work-around for this in OJS, as I've found that it's extremely easy to cause trouble with valid characters when trying to fix a problem like this. I'd suggest fixing the problem at its source by disabling smart quotes in Word. You may still have to do some manual search-and-replacing to correct existing data. IIRC, there may also be one or two external utilities to strip smart quotes out of a document.

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 9220
Joined: Wed Aug 10, 2005 12:56 pm

Postby nicollb » Thu Feb 01, 2007 7:46 am

Thanks, Alec - I replaced all of the problematic characters with "standard" equivalents, and now the article galleys upload.

I still have a problem seeing the galleys - but that is in a different posting.
nicollb
 
Posts: 15
Joined: Fri Sep 30, 2005 11:35 am


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 6 guests