Thanks for adding the functionality to add meta tags to paths, even the meta keywords and not just ignoring the issue with a link to a site explaining why they're not important. (We all know met keywords don't matter for SEO, but try convincing a computer illiterate person who's been told by their trusted friend so-and-so that they are. :)
I've got meta tags working for paths, but when the description entered is too long, it results in a SQL error. It does not check the length before attempting the INSERT and prompt the user to correct like on nodes.
This occurred in both alpha4 and dev.
Here is the error that's produced:
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'field_meta_description_metatags_quick' at row 1: INSERT INTO {field_data_field_meta_description} (entity_type, entity_id, revision_id, bundle, delta, language, field_meta_description_metatags_quick) 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] => metatags_path_based [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => metatags_path_based [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec pellentesque facilisis erat id sodales. Etiam bibendum nunc convallis lectus laoreet dignissim eu vitae turpis. Sed adipiscing nibh non dolor cursus et gravida velit semper. Proin faucibus sem nec eros scelerisque quis rhoncus ante molestie. Proin euismod aliquam pulvinar. Donec eget nisi eget sapien suscipit pretium. Fusce sed magna aliquet lorem suscipit rhoncus quis sit amet enim. Morbi sem nibh, hendrerit vitae posuere congue, ornare sed libero. Aliquam nec lorem diam, ut facilisis nisi. Vestibulum sit amet enim non ipsum elementum rutrum nec sit amet ligula. Integer elit orci, commodo in venenatis id, vehicula sed justo. Suspendisse lacus ipsum, elementum ac tempus eu, tincidunt nec est. Vestibulum commodo sem vitae eros molestie sit amet pellentesque turpis venenatis. ) in field_sql_storage_field_storage_write() (line 424 of /home/clients/websites/w_vista/public_html/vista/modules/field/modules/field_sql_storage/field_sql_storage.module).
Comment | File | Size | Author |
---|---|---|---|
#1 | path-based-form-validation-1204320.patch | 527 bytes | valthebald |
Comments
Comment #1
valthebaldComment #2
cwithout CreditAttribution: cwithout commentedPatch works. Thanks.
Comment #4
osopolarI updated to current dev. Although this was marked fixed I get still the PDOException if the description is too long (256 or characters).
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'meta_description_metatags_quick' at row 1: INSERT INTO {field_data_meta_description} (entity_type, entity_id, revision_id, bundle, delta, language, meta_description_metatags_quick) 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] => node [:db_insert_placeholder_1] => 26 [:db_insert_placeholder_2] => 33 [:db_insert_placeholder_3] => tour [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123451 ) in field_sql_storage_field_storage_write() (line 448 of /home/domain/public_html/modules/field/modules/field_sql_storage/field_sql_storage.module).
Comment #5
valthebaldThat's strange. Do you experience that with path-based or node meta tags?
There is implementation of hook_field_validate (http://api.drupal.org/api/drupal/modules!field!field.api.php/function/ho...):
Comment #6
rv0 CreditAttribution: rv0 commentedthe problem is metatags_quick_field_widget_form does not ad the validator in its "default" fallback
to fix this, better add the correct textarea code
Comment #7
rv0 CreditAttribution: rv0 commentedsee #6
Comment #8
valthebaldShouldn't it be #element_validate, not #validate?
Comment #9
valthebaldCan't reproduce this error, neither with path-based nor with node meta tags
Comment #10
rv0 CreditAttribution: rv0 commented@valthebald
looking at the latest version 7.x-2.7, I see there is no longer any #validate added in metatags_quick_field_widget_form.
so the code in #6 doesn't count any more and the issue is probably fixed.
the issue I had was in 7.x-2.5
Comment #11
valthebaldGreat, another fixed issue (hopefully)
Comment #12
osopolarI got the error with version 7.x-2.7 ... looking at the commit log it doesn't seem to be fixed in current dev neither.
Comment #13
valthebaldMaybe I'm missing something, but can't reproduce this.
Can you please explain what steps do you do to get this error?
Comment #14
valthebaldComment #15
osopolarI just typed in the node forms meta_description field (stored in field_data_meta_description) a text longer than 255 characters like:
The error message I got is:
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'meta_description_metatags_quick' at row 1: INSERT INTO {field_data_meta_description} (entity_type, entity_id, revision_id, bundle, delta, language, meta_description_metatags_quick) 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] => node [:db_insert_placeholder_1] => 100 [:db_insert_placeholder_2] => 354 [:db_insert_placeholder_3] => article [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456=260 ) in field_sql_storage_field_storage_write() (Zeile 448 von /home/web/public_html/modules/field/modules/field_sql_storage/field_sql_storage.module).
Maximal field length in admin/structure/types/manage/article/fields/meta_description/field-settings is set to 255.
I haven't tested with a clean install yet. the update-history of the module since installation:
Installed version was 7.x-1.9 (in 2011), on Feb 02 2012 I updated to 7.x-2.3+3-dev, on Aug 10 2012 to 7.x-2.5 and finally on Jan 19 2013 to 7.x-2.7.
Comment #16
valthebaldThat's interesting. The issue may indeed be caused by incorrect settings coming from older versions, since clean install definitely doesn't have this problem.
Let me check it.
Also, setting this to 'Active' ('needs work' means there is already at least rough solution, which needs improvement)
Comment #17
litvinova_yana CreditAttribution: litvinova_yana commentedHi!
I have faced this problem as well.
version = "7.x-2.7"
"Default maximum length" in a "Global settings" section does not affect max length of the fields... They have 160 symbols max unchanged.
Please, help!
Comment #18
hockey2112 CreditAttribution: hockey2112 commentedI also have this issue in 7.x-2.7. Any fix?
Here is my exact error message. The meta tag is lists is only 175 characters long.
Comment #19
MaximumHormone CreditAttribution: MaximumHormone commentedStill having this same issue
Here is my error
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'language' at row 1: INSERT INTO {metatag} (entity_type, entity_id, language, revision_id, data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 95 [:db_insert_placeholder_2] => twitter:player:stream:content_type [:db_insert_placeholder_3] => 95 [:db_insert_placeholder_4] => a:1:{s:5:"value";s:8:"Proprius";} ) in metatag_metatags_save() (line 555 of /Library/WebServer/Documents/Fun4Kids2/sites/all/modules/metatag/metatag.module).
line 555 is ->execute();
this is the whole block
// Update each of the per-language metatag configurations in turn.
foreach ($metatags as $langcode => $new_metatags) {
// Allow other modules to alter the meta tags prior to saving using
// hook_metatag_presave().
foreach (module_implements('metatag_presave') as $module) {
$function = "{$module}_metatag_presave";
$function($new_metatags, $entity_type, $entity_id, $revision_id, $langcode);
}
// If the data array is empty, there is no data to actually save, so just
// delete the record from the database.
if (empty($new_metatags)) {
db_delete('metatag')
->condition('entity_type', $entity_type)
->condition('entity_id', $entity_id)
->condition('revision_id', $revision_id)
->condition('language', $langcode)
->execute();
}
// Otherwise save the data for this entity.
else {
db_merge('metatag')
->key(array(
'entity_type' => $entity_type,
'entity_id' => $entity_id,
'language' => $langcode,
'revision_id' => $revision_id,
))
->fields(array(
'data' => serialize($new_metatags),
))
->execute();
}
}
was there any thing that was resolved using the latest 7 install?
Comment #20
Kamlendra CreditAttribution: Kamlendra as a volunteer commentedIssue still persists,
I've migrated D6 to D7, D6 version of my site was using nodewords module for metatags and now I'm using Meta tags quick module to migrate meta tags.
While migrating meta tags I got the same error, Error message from dblog is pasted here
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'meta_description_metatags_quick' at row 1: INSERT INTO {field_data_meta_description} (entity_type, entity_id, revision_id, bundle, delta, language, meta_description_metatags_quick) 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] => node [:db_insert_placeholder_1] => 403582 [:db_insert_placeholder_2] => 438563 [:db_insert_placeholder_3] => story [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => NEW SMYRNA BEACH - Dr. Arlen Stauffer, a physician and chairman of the NSB Balloon Fest, was chosen at tonight's City Commission meeting as New Smyrna Beach's nominee the Volusia Leaque of Cities' citizen of the year award. ) in field_sql_storage_field_storage_write() (line 514 of /var/www/headlines-surfer/modules/field/modules/field_sql_storage/field_sql_storage.module).
Comment #21
schifazl CreditAttribution: schifazl commentedI'm having this issue too