Comments

szantog’s picture

Status: Active » Needs review
StatusFileSize
new1.31 KB

And fix it.

szantog’s picture

StatusFileSize
new1.25 KB

aa fix patch

iva2k’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.84 KB

I found another typo. Unfortunately I already did migration from D6 and cannot test the whole update at once. I did it in bits and pieces, fixing errors and trying next step (by commenting out passed steps).
Given that the typos are obvious and missing call to schema switch was needed (I did it by hand). marking as RTBC.

liam mcdermott’s picture

Status: Reviewed & tested by the community » Fixed
iva2k’s picture

Status: Fixed » Reviewed & tested by the community
StatusFileSize
new1.72 KB

Sorry, my mistake - I did not clean out one commented out line which should remain (db_rename_table('signature_post', 'signature_forum_post');).

Please commit this patch instead. (Or restore "db_rename_table('signature_post', 'signature_forum_post');" line)

diakonos’s picture

Status: Fixed » Reviewed & tested by the community

I recently upgrade a site from Drupal 5 to Drupal 6 to Drupal 7 with the signature forum module to update. I found that there was an error during the update.php script. The error included the following: 1406 Data too long for column 'signature' [Sorry I don't have the full error message, but it referred to an error code, update statement and the following columms.]
I looked in the database and compared the {users}.signature column with the {users_signature}.signature column and found that the signature column in the {users} table is "varchar(255)" whereas the one in the {user_signature} table is "text".

This prompted me to investigate this further using:
SELECT uid, signature, LENGTH( signature )
FROM `users_signature`
WHERE LENGTH( users_signature.signature ) >255

Which I then discovered that there were indeed records in the {users_signature}.signature column to be greater than 255 chars. Needless to say that this was the primary cause of my update script failure. I subsequently deleted all the offending entries, but I have not tested the update script yet since it is on a production site. I will have to wait for the maintenance cycle.

Hope this helps someone or help to identify bugs that may need to be fixed. I will update this post as soon as I find out more about the update. Thanks.

UPDATE: Here was the complete original error message that I did not have before.

The following updates returned messages
signature_forum module
Update #7000
Failed: PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'signature' at row 1: UPDATE {users}, {users_signature} SET {users}.signature = {users_signature}.signature WHERE {users}.uid = {users_signature}.uid; Array ( ) in signature_forum_update_7000() (line 130 of /var/www/html/drupal/_stage_d7/drupal-7.18/sites/all/modules/signature_forum/signature_forum.install).

Now, I have the following errors:

signature_forum module
Update #7000
    Failed: DatabaseSchemaObjectDoesNotExistException: Cannot rename <em class="placeholder">signature_post</em> to <em class="placeholder">signature_forum_post</em>: table <em class="placeholder">signature_post</em> doesn't exist. in DatabaseSchema_mysql->renameTable() (line 304 of /var/www/html/drupal/drupal-7.18/includes/database/mysql/schema.inc).

Any thoughts would be helpful. Thanks.

liam mcdermott’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new966 bytes

@ #5: I've already committed the patch in #3, so thought any new changes should go in another update.

Does the attached patch sense to you? If so, I'll commit it.

iva2k’s picture

StatusFileSize
new588 bytes

Nope, sorry if I confused you. Patch in #7 does not restore the mistakenly commented-out line.
Here's what I meant - see the patch.

UPDATE:
Don't use this patch, use #7

liam mcdermott’s picture

Status: Needs review » Postponed (maintainer needs more info)

I'm confused, the patch in #8 seems to do the same thing as the patch in #7? The only difference is the mistakenly commented-out line is moved to a separate update function, so anyone who's already upgraded to the latest -dev release will also get the table name change.

The only thing I'm slightly concerned about #7 is: if someone's coming from the 6.x --> 7.x version of Signatures, will Drupal run both the 7000 and 7100 update functions? Or should the line with the db_rename_table() call in it be in both update functions?

iva2k’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

Yep, you're right. I did not get that part... #7 is good. I better stop reading patches after long day at work.

liam mcdermott’s picture

Status: Reviewed & tested by the community » Fixed

Yep, you're right. I did not get that part... #7 is good. I better stop reading patches after long day at work.

Hehehe, no worries! I also snuck in a docblock change into that patch and it wasn't immediately obvious the missing line had actually been moved down into its own update function. :)

Committed #7:
http://drupal.org/commitlog/commit/4512/0c9ebd48fe39ad06f509d491f6ce271f...

liam mcdermott’s picture

@ #6: diakonos, sorry this is a pain, but would you mind creating a new issue for your problem using the 'Create new issue' link on this page?

It seems your problem is mostly unrelated to this issue. Thanks! :)

diakonos’s picture

Status: Reviewed & tested by the community » Fixed

No problem. Thanks for the response.

Status: Fixed » Closed (fixed)

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