summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Chedemois2008-11-03 20:56:13 (GMT)
committer Yves Chedemois2008-11-03 20:56:13 (GMT)
commit63d67915de3e7c4b5f4223af21519660fe1a3326 (patch)
treef5120c9ee15948437247952a76a634730b34ff71
parent947b1b770fae9ed94692600ff291b0f0b5cd7674 (diff)
#311912 Views integration: The many_to_one filters for fields with 'allowed values' gain should not replace the regular 'starts with'/'greater than' filters.
-rw-r--r--CHANGELOG.txt17
-rw-r--r--includes/views/content.views.inc1
-rw-r--r--modules/number/number.module10
-rw-r--r--modules/text/text.module8
4 files changed, 27 insertions, 9 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 0897c0a..10c927a 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -3,12 +3,23 @@
CCK 6.2-dev
===========
+Note: Filters available for CCK fields in Views have changed slightly since the RC releases.
+If upgrading from a RC release, you might need to check your views, and if needed.
+This only applies to filters defined on Text or Number fields that specify a list of 'Allowed values'.
+Filters on other CCK fields are not affected.
+
+Main new features since RC10:
+- #300368 Add option on Display fields screen to omit fields or groups from the $content value passed to the node template.
+- #298651 by smk-ka, yched - Nodereference/Userreference: Enhance performance on large sites.
+ This also adds 'autocomplete mode' widget settings (full string / beginning of string).
+- #329447 add content_view_field() API function to display a single field, fully themed with label and multiple values, to be used by 3rd party code.
+
+Other changes:
- #329037 Fix small bug in content_generate function method of calling fields that handle their own multiple values.
- #324826 Change Advanced help path and topic to use & prefix per latest change in Advanced help.
- #324610 Add Advanced help files for basic fields and hooks so they'll show up in the CCK advanced help documentation. Intended to be used as examples by other field modules for a way to add more field documentation.
- #321024 Add content_associate_fields() to the content_check_update() function because it can get skipped when updates are aborted or the content module is not yet updated.
- Fix bad logic in testing content version variable to prevent warning messages before content module is updated.
-- #300368 Add option on Display fields screen to omit fields or groups from the $content value passed to the node template.
- Get rid of t() around Views field label since Views already has it marked as a translatable option.
- #285470 by jhuckabee, store field label in the view in all cases, previously only custom labels were stored.
- #266309 by abbasmousavi, change silent fix to error message for invalid input into number fields.
@@ -25,8 +36,6 @@ CCK 6.2-dev
- Replaced theming instructions in theme/README.txt with advanced_help pages.
- #323436 by hass: fix a few strings + translation bugs.
- #323745 by robertgarrigos: Fix performance issue when submitting 'display fields' form.
-- #298651 by smk-ka, yched - Nodereference/Userreference: Enhance performance on large sites.
- This also adds 'autocomplete mode' widget settings (full string / beginning of string).
- #316292 by fractile81: Turn potentially time-consuming updates into multi-pass updates.
- Remove unwanted 'N/A' option on noderef/userref fields using checkboxes.
- #319131 by Moonshine - Add 'title-raw' token for noderef fields.
@@ -42,8 +51,8 @@ CCK 6.2-dev
- #328763 Adjust weight of non-cck fields even if there are no CCK fields for the content type.
- Views integration: fixed a few non-relationship safe areas.
- Views integration: fix 'link this field to its node'+'group multiple'+relationships.
-- #329447 add content_view_field() API function to display a single field, fully themed with label and multiple values, to be used by 3rd party code.
- #323681 Panels integration: make 'field as pane' work again.
+- #311912 Views integration: The many_to_one filters for fields with 'allowed values' gain should not replace the regular 'starts with'/'greater than' filters.
CCK 6.2-rc10
============
diff --git a/includes/views/content.views.inc b/includes/views/content.views.inc
index de12b1b..f042c97 100644
--- a/includes/views/content.views.inc
+++ b/includes/views/content.views.inc
@@ -220,6 +220,7 @@ function content_views_field_views_data($field) {
$data[$columns[0]] = array(
'group' => t('Content'),
'title' => t($field['widget']['label']) . ' ('. $field['field_name'] .')',
+ 'title_short' => t($field['widget']['label']),
'help' => t($field_types[$field['type']]['label']) .' - '. t('Appears in: @types', array('@types' => implode(', ', $types))),
'field' => array(
'field' => $columns[0],
diff --git a/modules/number/number.module b/modules/number/number.module
index c90a7e8..b6a062c 100644
--- a/modules/number/number.module
+++ b/modules/number/number.module
@@ -173,9 +173,13 @@ function number_field_settings($op, $field) {
$db_info = content_database_info($field);
$table_alias = content_views_tablename($field);
- // Filter: swap the handler to the 'many to one' operator.
- $data[$table_alias][$field['field_name'] .'_value']['filter']['handler'] = 'content_handler_filter_many_to_one';
- $data[$table_alias][$field['field_name'] .'_value']['filter']['numeric'] = TRUE;
+ // Filter: Add a 'many to one' filter.
+ $copy = $data[$table_alias][$field['field_name'] .'_value'];
+ $copy['title'] = check_plain(t($field['widget']['label'])) .' ('. $field['field_name'] .') - Allowed values.';
+ $copy['filter']['handler'] = 'content_handler_filter_many_to_one';
+ $copy['filter']['numeric'] = TRUE;
+ unset($copy['field'], $copy['argument'], $copy['sort']);
+ $data[$table_alias][$field['field_name'] .'_value_many_to_one'] = $copy;
// Argument: swap the handler to the 'many to one' operator
$data[$table_alias][$field['field_name'] .'_value']['argument']['handler'] = 'content_handler_argument_many_to_one';
$data[$table_alias][$field['field_name'] .'_value']['argument']['numeric'] = TRUE;
diff --git a/modules/text/text.module b/modules/text/text.module
index 7b54409..2b80d21 100644
--- a/modules/text/text.module
+++ b/modules/text/text.module
@@ -126,8 +126,12 @@ function text_field_settings($op, $field) {
$db_info = content_database_info($field);
$table_alias = content_views_tablename($field);
- // Filter: swap the handler to the 'many to one' operator.
- $data[$table_alias][$field['field_name'] .'_value']['filter']['handler'] = 'content_handler_filter_many_to_one';
+ // Filter: Add a 'many to one' filter.
+ $copy = $data[$table_alias][$field['field_name'] .'_value'];
+ $copy['title'] = check_plain(t($field['widget']['label'])) .' ('. $field['field_name'] .') - '. t('Allowed values');
+ $copy['filter']['handler'] = 'content_handler_filter_many_to_one';
+ unset($copy['field'], $copy['argument'], $copy['sort']);
+ $data[$table_alias][$field['field_name'] .'_value_many_to_one'] = $copy;
// Argument : swap the handler to the 'many to one' operator.
$data[$table_alias][$field['field_name'] .'_value']['argument']['handler'] = 'content_handler_argument_many_to_one';
return $data;