When configuring a Block Inject region for multiple content types, the following error was thrown.
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'node_name' at row 1: UPDATE {block_inject} SET region=:db_update_placeholder_0, node_type=:db_update_placeholder_1, node_name=:db_update_placeholder_2 WHERE (id = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => Adsense Body [:db_update_placeholder_1] => blog, page, story, book, article [:db_update_placeholder_2] => Blog entry, Page, Story, Book page, Article [:db_condition_placeholder_0] => 1 ) in block_inject_update_region() (line 293 of /usr/local/data/d7.modules/block_inject/block_inject.module).
Altering the block_inject table fields node_type and node_name from varchar(36) to varchar(256) corrected the problem.
This will continue to be an issue on sites with a large number of content types if the entire list is stored in a single field. Perhaps the code base should be restructured to permit better handling of the list, perhaps as multiple records.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | block_inject-table-update-1957216-4.patch | 1.15 KB | Triskelion |
| #3 | block_inject-table-update-1957216-2.patch | 666 bytes | upchuk |
| #2 | block_inject-table-update-#1957216-#2.patch | 666 bytes | upchuk |
Comments
Comment #1
upchuk commentedHey there triskelion,
I can't believe I left varchar(36). That does have to be changed and I will put out a new release with an update.
I think the field can also be bigger than a varchar (like a TEXT or something) so also larger sites can fit their content types in there.
Thanks for letting me know!
Comment #2
upchuk commentedI created a patch for this update. If you wouldn't mind checking it out.
Will include it in the next release.
Cheers!
Comment #3
upchuk commentedSorry, I think there was a problem with the filename and I couldn't edit my earlier comment attachment which is weird..
Here you have the correct attachment.
Comment #4
Triskelion commentedI tested your patch and it applied fine, but the update was not detected. Have made a couple of minor changes so the update works. Noticed you included the patch in the dev version, so I rolled the patch against the current dev.
Comment #5
upchuk commentedCool!
Thanks! Wonder why for you the update was not detected. As far as I can see you only removed the $sandbox param. I will roll this back into the dev version and when the other issue is fixed too I will put out a new release.
Thanks for your help.
Comment #7
inferno_msk commentedPDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'u3311_drupal7.block_inject_exceptions' doesn't exist: SELECT bie.bi_id AS bi_id FROM {block_inject_exceptions} bie WHERE (nid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 1492 ) в функции block_inject_green_light() (строка 464 в файле /home/u3311/domains/site.ru/sites/all/modules/block_inject/block_inject.module).
path - not work!!!
Comment #8
upchuk commentedA yes, I'm on it, sorry about that!
Comment #9
upchuk commentedTry updating to the new release.