summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Chedemois2011-12-22 23:23:13 (GMT)
committerYves Chedemois2011-12-22 23:23:31 (GMT)
commit541f71cee89e13271b928f5a63a00b5c85ecc994 (patch)
tree41807246176ec940c5ea1fe35f6f42693508c996
parent6a71d4d9f7f6191d5468bfe8a7ede6fa9373582a (diff)
Issue #1139238 by wondex, s_leu: Add relevant meta data in the 'potential_references' db query to allow smart alteration.7.x-2.0
-rw-r--r--CHANGELOG.txt2
-rw-r--r--node_reference/node_reference.module6
-rw-r--r--user_reference/user_reference.module6
3 files changed, 10 insertions, 4 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 664061d..af4cf6d 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -66,6 +66,8 @@ settings" will lose the currently selected view if it doesn't have a
Reference views if it is not present in the view definition.
#1155946 by yched: allow HTML in "checkboxes / radios" widgets (for lists of
referenceable targets generated by views).
+#1139238 by wondex, s_leu: Add relevant meta data in the 'potential_references'
+ db query to allow smart alteration.
References 7.x-2.0-beta3
========================
diff --git a/node_reference/node_reference.module b/node_reference/node_reference.module
index fdd984f..95560ed 100644
--- a/node_reference/node_reference.module
+++ b/node_reference/node_reference.module
@@ -845,8 +845,10 @@ function _node_reference_potential_references_standard($field, $options) {
$node_nid_alias = $query->addField('n', 'nid');
$node_title_alias = $query->addField('n', 'title', 'node_title');
$node_type_alias = $query->addField('n', 'type', 'node_type');
- $query->addTag('node_access');
- $query->addMetaData('id', ' _node_reference_potential_references_standard');
+ $query->addTag('node_access')
+ ->addMetaData('id', ' _node_reference_potential_references_standard')
+ ->addMetaData('field', $field)
+ ->addMetaData('options', $options);
if (is_array($field['settings']['referenceable_types'])) {
$query->condition('n.type', $field['settings']['referenceable_types'], 'IN');
diff --git a/user_reference/user_reference.module b/user_reference/user_reference.module
index 53ae46c..c8b26b5 100644
--- a/user_reference/user_reference.module
+++ b/user_reference/user_reference.module
@@ -867,10 +867,12 @@ function _user_reference_potential_references_standard($field, $options) {
}
$query = db_select('users', 'u')
- ->addMetaData('id', ' _user_reference_potential_references_standard')
// Select the whole record, so that format_username() has enough
// information.
- ->fields('u');
+ ->fields('u')
+ ->addMetaData('id', ' _user_reference_potential_references_standard')
+ ->addMetaData('field', $field)
+ ->addMetaData('options', $options);
// Enable this filter only if any statuses checked (and not both).
if (count($filter_status) == 1) {