Skip to content

Instantly share code, notes, and snippets.

View makara's full-sized avatar

Makara Wang makara

  • Wiredcraft
  • Shanghai, China
View GitHub Profile
diff --git includes/features.user.inc includes/features.user.inc
index c76455d..a11e078 100644
--- includes/features.user.inc
+++ includes/features.user.inc
@@ -26,12 +26,10 @@ function user_features_api() {
function user_permission_features_export($data, &$export, $module_name = '') {
$export['dependencies']['features'] = 'features';
- // Ensure the modules that provide the given permissions are included as dependencies.
+ // Ensure the given permissions exist.
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 379de71..761cc08 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -1715,6 +1715,15 @@ function taxonomy_rdf_mapping() {
function taxonomy_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
foreach ($items as $delta => $item) {
if ($item['tid'] == 'autocreate') {
+ // Avoid duplicating tags within the same vocabulary.
+ $tid = db_query_range("SELECT tid FROM {taxonomy_term_data} WHERE name = :name AND vid = :vid", 0, 1, array(
diff --git modules/taxonomy/taxonomy.module modules/taxonomy/taxonomy.module
index dc2847d..64f9083 100644
--- modules/taxonomy/taxonomy.module
+++ modules/taxonomy/taxonomy.module
@@ -1689,16 +1689,7 @@ function taxonomy_field_insert($entity_type, $entity, $field, $instance, $langco
// We maintain a denormalized table of term/node relationships, containing
// only data for current, published nodes.
if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $entity_type == 'node' && $entity->status) {
- $query = db_insert('taxonomy_index')->fields(array('nid', 'tid', 'sticky', 'created', ));
- foreach ($items as $item) {
diff --git legacy_reference.module legacy_reference.module
index 43ffc1b..99141da 100644
--- legacy_reference.module
+++ legacy_reference.module
@@ -242,7 +242,7 @@ function legacy_reference_feeds_processor_targets_alter(&$targets, $entity_type,
if ($info['type'] == 'legacy_reference') {
$targets[$name] = array(
'name' => $instance['label'],
- 'callback' => 'field_feeds_set_target_text',
+ 'callback' => 'legacy_reference_feeds_set_target',