Révision b1ab1c0c
Ajouté par Assos Assos il y a plus de 7 ans
drupal7/sites/all/modules/entityreference/plugins/behavior/EntityReferenceBehavior_TaxonomyIndex.class.php | ||
---|---|---|
144 | 144 |
// already inserted in taxonomy_build_node_index(). |
145 | 145 |
$tid_all = array_diff($tid_all, $original_tid_all); |
146 | 146 |
|
147 |
// Insert index entries for all the node's terms. |
|
147 |
// Insert index entries for all the node's terms, preventing duplicates.
|
|
148 | 148 |
if (!empty($tid_all)) { |
149 |
$query = db_insert('taxonomy_index')->fields(array('nid', 'tid', 'sticky', 'created')); |
|
150 | 149 |
foreach ($tid_all as $tid) { |
151 |
$query->values(array(
|
|
150 |
$row = array(
|
|
152 | 151 |
'nid' => $node->nid, |
153 | 152 |
'tid' => $tid, |
154 | 153 |
'sticky' => $sticky, |
155 | 154 |
'created' => $node->created, |
156 |
)); |
|
155 |
); |
|
156 |
$query = db_merge('taxonomy_index') |
|
157 |
->key($row) |
|
158 |
->fields($row); |
|
159 |
$query->execute(); |
|
157 | 160 |
} |
158 |
$query->execute(); |
|
159 | 161 |
} |
160 | 162 |
} |
161 | 163 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules