Parse error: syntax error, unexpected ':' in /sites/all/modules/block_class/block_class.module on line 36
It's at the end of the line of help text "you must add print block classes to your themes block.tpl.php"
Once I got that it was a "specified key was too long" PDO error.
This has something to do with Unicode characters taking up more than a standard byte.
Something like the following fixes it:
'primary key' => array(array('module', 128), array('delta', 128)),
It has to be shorter than 333 or so characters, because each letter of the key takes up 3 bytes. (at least on my server)
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | block_class.install-schema.15.patch | 3.29 KB | sun |
| #10 | block_class-1020846-10.patch | 2.3 KB | mark trapp |
| #9 | block_class_1020846.patch | 1.67 KB | yang_yi_cn |
| #6 | block_class.1020846_01_d6.patch | 1.98 KB | sgabe |
| #6 | block_class.1020846_01_d7.patch | 2.45 KB | sgabe |
Comments
Comment #1
mlncn commentedsubscribe. a fix and a release possible soon?
Comment #2
todd nienkerk commentedThis has been fixed. Sorry about that!
I'm hesitant to apply the patch listed in #982980: #1071 - Specified key was too long; max key length is 1000 bytes -> kills site & possible backups wont work for a couple of reasons:
That patch hasn't been accepted by that module, so it's not necessarily the best solution.
Limiting the key length to 128 characters seems to conflict with the stated length of 255 characters for the module and delta fields. These fields were extended to 255 characters in a recent version of the 6.x branch of the module; shortening the field could result in data loss in some rare cases.
I'll take a deeper look today.
Comment #3
elliotttf commentedThe patch in #1020790: Port schema update to 7.x-1.x branch addresses this issue. Changing the key length does not reduce the amount of data that is stored, only the amount of data that is used for indexing.
Comment #4
elliotttf commentedCommitted @ http://drupal.org/cvs?commit=480696
Run update.php for the change to take effect.
Comment #6
sgabe commentedI think the solution introduced here is not correct. We should adhere to the core Block module's database scheme and set the length 64 for the module field and 32 for delta. These fields are needlessly long.
The attached patches are for DRUPAL-6--1 and DRUPAL-7--1. IMO this bug should be fixed for DRUPAL-6--1 ASAP, the module cannot be installed in the current state.
Comment #7
yang_yi_cn commented#610010: CSS Class field is limited to 50 chars is marked as a dup of this
Comment #8
yang_yi_cn commentedas I mentioned in #610010: CSS Class field is limited to 50 chars, the current dev has a bug and #6 didn't fix that, which is the field definition of "css_class" is not correct, it should be "length" instead of "size".
Comment #9
yang_yi_cn commentedPatch rolled for D6. I don't have too much experience with D7 so I cannot make one for D7. If someone can do it for D7, appreciated.
Comment #10
mark trappPatch for Drupal 7 in #6 didn't apply cleanly, so I had to reroll it; it otherwise solves the problem. This should probably be fixed in the 7.x-1.x first then backported to 6.x as 7.x is the current Drupal release.
Comment #11
todd nienkerk commented@Mark Trapp: Thanks for the re-roll. Can you apply that patch to 7.x-1.x and reroll for 6.x-1.x?
Comment #12
eric.chenchao commentedsubscribe
Comment #13
berenddeboer commentedIt appears the patch has been applied everywhere I can see, so marked as closed.
Comment #14
sgabe commentedI don't know where did you see that, but this issue is still valid, you can see it in the repository.
Comment #15
sunYou MUST NOT change or edit existing module update functions.
Attached patch fixes this bug properly.
#1287662: 6.x-1.x fails to install database schema fixes the same error for 6.x-1.x.
Comment #16
sunAny updates? This is a critical bug.
Comment #17
berenddeboer commentedPatch committed.