Closed (won't fix)
Project:
DART
Version:
7.x-2.4
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2012 at 04:01 UTC
Updated:
3 Sep 2012 at 14:14 UTC
Jump to comment: Most recent file
A maximum length for the machine name field should be kept at 32 characters because the delta column for the blocks tables is only 32 character in length.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 1413678.patch | 2.57 KB | bleen |
| #3 | dart_maxlength_delta-1413678.patch | 475 bytes | cntlscrut |
| dart_1410530-1.patch | 650 bytes | cntlscrut |
Comments
Comment #1
bleen commentednice catch - thanks!
This has been committed to 7.x-2.x-dev http://drupalcode.org/project/dart.git/commit/bd0e021
Comment #2
cntlscrut commentedI reopened this ticket as I found that even with the character limit, the block build is prepending the block machine name with "dart-tag-" which for a user given machine name over 23 chars maxes out the column length and causes this error:
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'delta' at row 1: INSERT INTO {block} (module, delta, theme, status, weight, region, pages) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => dart [:db_insert_placeholder_1] => dart-tag-testing_for_a_really_long_name_b [:db_insert_placeholder_2] => bartik [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => -1 [:db_insert_placeholder_6] => ) in drupal_write_record() (line 6888 of /web/jam.geoffmaxey.com/html/includes/common.inc).
Comment #3
cntlscrut commentedSo, after some searching I found that the info array in the hook_block_info implementation was adding the "dart-tag-" prefix to the block delta (which can only be 32 chars in length).
I found that by removing that prefix and sticking with the 32 maxlength value from the earlier patch prevented this from occurring.
So, here's a patch for consideration in this issue:
Comment #4
bleen commentedhere's my problem ... if I remove the prefix from hook_block_info() I need to remove it from hook_block_view also ... and if I do that then I need to update the deltas for all existing blocks in the database.... and if I do THAT then the id will change on DART blocks and that can mess up people's css
Hmmmmmm... any ideas?
Comment #5
cntlscrut commentedSo, I did some further testing to determine the effect of that change and found that it did not hender anything.
- The hook_block_view is removing the "dart-tag" prefix from the delta before checking/loading the block which doesn't affect the block loading.
- the css classes are not affected by the change.
- The main thing that i did find was that when the hook_block_info was run again there were duplicates of the blocks in there.
The dups in the db were the only main problem that i ran across. A quick update script could fix that. The only thing I would want to double check is how to maintain block placement post an update and check that for sites using features, that the block values would either translate or cause dups, as well.
I don't mind building the update.
thoughts?
Comment #6
bleen commentedis the ID effected? In theory some people may have css defined for the ID of their blocks. Other than that, I would be happy to review your patch if it includes an update function to (hopefully) remedy this in a non-destructive way.
Comment #7
bleen commentedI was going to commit the attached patch, but I realize that this will break any site using context or panels to place blocks. Basically, it is unacceptable to change the delta of a block without totally borking people's sites.
For this reason, I'm marking this "wont fix".