Commit d748fcb7 authored by KarenS's avatar KarenS

#198420 Make sure internal field and widget names are truncated to 32...

#198420  Make sure internal field and widget names are truncated to 32 characters to match the database values.
parent 010dc7af
......@@ -6,6 +6,9 @@
Bugfix
------
General
- #198420 Make sure internal field and widget names are truncated to 32 characters to match the database values.
Field / widget modules
- #140687 OptionWidgets : fix 'single checkbox' stick on checked when used with text values.
......@@ -28,16 +31,16 @@ Field / widget modules
4.7--1.6
========
IMPORTANT : this release fixes two cross-site scripting (XSS) vulnerabilities
IMPORTANT : this release fixes two cross-site scripting (XSS) vulnerabilities
in nodereference.module :
- when a nodereference field is displayed using the 'plain' formatter
- when a nodereference field is edited using the 'autocomplete text field' widget
(only when _not_ using the 'advanced options - Views.module' for the field)
- when a nodereference field is edited using the 'autocomplete text field' widget
(only when _not_ using the 'advanced options - Views.module' for the field)
All sites using CCK / nodereference.module should consider upgrading to this release
as soon as possible.
Features
Features
--------
General
......@@ -47,7 +50,7 @@ General
- #151347 Refactor content_field('load') to make it more legible.
Field / widget modules
- #152892 Optionwidgets : Better help text for 'single on/off checkbox' widget label.
- #152892 Optionwidgets : Better help text for 'single on/off checkbox' widget label.
- #65133 / #152016 Nodereference : Added 'full node' and 'teaser' formatters.
- #126926 Nodereference : Skip node_load in 'title'-based formatters.
......@@ -79,19 +82,19 @@ Bugfix
4.7--1.5
========
Features
Features
--------
- #126333 Update to Views 1.6 API
- #126333 Update to Views 1.6 API
(no need to update cached queries on field setup changes anymore)
- #126776 Enhance 'default value php code' help text and error message.
- minor - collapse 'default value php code' if empty
Bugfix
------
General
- #128994 Fix for 'ungroup multiple values' views handler populating every 'column'
of the values with the first column (revert http://drupal.org/cvs?commit=58000)
of the values with the first column (revert http://drupal.org/cvs?commit=58000)
- #116775 Stupid conflict on field form when field_name == 'name'
- #125185 fix minor error in update_10.
......@@ -148,7 +151,7 @@ Field / widget modules
- #108302 Number : Added formatters for numbers (+ be sure non-numeric data is not stored)
- #110570 Number : Added prefix and suffix option
- #111129 Optionwidgets : Added widget to handle single on/off checkbox
- #112464 Standardize validation in field rather than widget,
- #112464 Standardize validation in field rather than widget,
Standardize use of $items rather than $node_field
Bugfix
......
......@@ -777,28 +777,36 @@ function _content_type_info($reset = FALSE) {
$module_field_types = module_invoke($module, 'field_info');
if ($module_field_types) {
foreach ($module_field_types as $name => $field_info) {
$info['field types'][$name] = $field_info;
$info['field types'][$name]['module'] = $module;
$info['field types'][$name]['formatters'] = array();
// Truncate names to match the value that is stored in the database.
$db_name = substr($name, 0, 32);
$info['field types'][$db_name] = $field_info;
$info['field types'][$db_name]['module'] = $module;
$info['field types'][$db_name]['formatters'] = array();
}
}
$module_widgets = module_invoke($module, 'widget_info');
if ($module_widgets) {
foreach ($module_widgets as $name => $widget_info) {
$info['widget types'][$name] = $widget_info;
$info['widget types'][$name]['module'] = $module;
// Truncate names to match the value that is stored in the database.
$db_name = substr($name, 0, 32);
$info['widget types'][$db_name] = $widget_info;
$info['widget types'][$db_name]['module'] = $module;
foreach ($widget_info['field types'] as $delta => $type) {
$info['widget types'][$db_name][$delta] = substr($type, 0, 32);
}
}
}
}
foreach (module_list() as $module) {
$module_formatters = module_invoke($module, 'field_formatter_info');
if ($module_formatters) {
foreach ($module_formatters as $name => $formatter_info) {
foreach ($formatter_info['field types'] as $field_type) {
$info['field types'][$field_type]['formatters'][$name] = $formatter_info;
$info['field types'][$field_type]['formatters'][$name]['module'] = $module;
// Truncate names to match the value that is stored in the database.
$db_name = substr($field_type, 0, 32);
$info['field types'][$db_name]['formatters'][$name] = $formatter_info;
$info['field types'][$db_name]['formatters'][$name]['module'] = $module;
}
}
}
......@@ -1036,7 +1044,7 @@ function content_simpletest() {
*
* @param $field
* The field array, including widget info.
* @return
* CONTENT_CALLBACK_NONE - do nothing for this operation
* CONTENT_CALLBACK_CUSTOM - use the module's callback function.
......@@ -1047,7 +1055,7 @@ function content_handle($entity, $op, $field) {
$entity_types = ($entity == 'field') ? _content_field_types() : _content_widget_types();
$entity_type = ($entity == 'field') ? $field['type'] : $field['widget']['type'];
$module = $entity_types[$entity_type]['module'];
if ($op == 'default value' && $module == 'computed_field') {
$callback_value = CONTENT_CALLBACK_NONE;
}
......
......@@ -27,6 +27,9 @@
* An array keyed by field type name. Each element of the array is an associative
* array with these keys and values:
* - "label": The human-readable label for the field type.
*
* IMPORTANT! - field and widget names will be truncated to 32 characters in
* the database and in internal arrays, like content_fields().
*/
function hook_field_info() {
return array(
......@@ -307,6 +310,9 @@ function hook_field_formatter($field, $item, $formatter, $node) {
* - "label": The human-readable label for the widget.
* - "field types": An array of field type names that can be edited using
* this widget.
*
* IMPORTANT! - field and widget names will be truncated to 32 characters in
* the database and in internal arrays, like content_fields().
*/
function hook_widget_info() {
return array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment