Commit 6b90195b authored by git's avatar git Committed by Peter Philipp
Browse files

Issue #2511848 by Oleksiy: Allow to alter query of features export options

parent c46cb004
......@@ -23,7 +23,8 @@ function uuid_bean_features_export_options() {
$query->fields('n', array('bid', 'delta', 'type', 'uuid'))
->condition('type', $types)
->orderBy('type')
->orderBy('delta', 'ASC');
->orderBy('delta', 'ASC')
->addTag('uuid_bean_features_export_options');
$beans = $query->execute()->fetchAll();
foreach ($beans as $bean) {
$options[$bean->uuid] = t('@type: @delta', array(
......
......@@ -28,7 +28,8 @@ function uuid_book_features_export_options() {
$query
->entityCondition('entity_type', 'node')
->propertyCondition('nid', $book_nids, 'IN')
->propertyOrderBy('title');
->propertyOrderBy('title')
->addTag('uuid_book_features_export_options');
$result = $query->execute();
if (!empty($result['node'])) {
$nodes = node_load_multiple(array_keys($result['node']));
......
......@@ -18,7 +18,8 @@ function uuid_commerce_product_features_export_options() {
$query->fields('cp', array('product_id', 'title', 'type', 'uuid'))
->condition('type', $enabled_types)
->orderBy('type')
->orderBy('title');
->orderBy('title')
->addTag('uuid_commerce_product_features_export_options');
$products = $query->execute()->fetchAll();
foreach ($products as $product) {
$options[$product->uuid] = t('@type: @title', array(
......
......@@ -12,6 +12,7 @@ function uuid_current_search_configuration_features_export_options() {
$current_search_items = db_select('block_current_search', 'b')
->fields('b', array('delta', 'searcher'))
->addTag('uuid_current_search_configuration_features_export_options')
->execute()
->fetchAllAssoc('delta');
......
......@@ -23,6 +23,7 @@ function uuid_field_collection_features_export_options() {
$efq_field_collection_items = new EntityFieldQuery();
$efq_field_collection_items->entityCondition('entity_type', 'field_collection_item');
$efq_field_collection_items->entityCondition('bundle', $enabled_bundles);
$efq_field_collection_items->addTag('uuid_field_collection_features_export_options');
$result = $efq_field_collection_items->execute();
if (!empty($result['field_collection_item'])) {
......
......@@ -18,7 +18,8 @@ function uuid_file_entity_features_export_options() {
->entityCondition('entity_type', 'file')
->propertyCondition('type', $enabled_types, 'IN')
->propertyOrderBy('filename')
->propertyOrderBy('type');
->propertyOrderBy('type')
->addTag('uuid_file_entity_features_export_options');
$result = $query->execute();
if (!empty($result['file'])) {
......
......@@ -10,9 +10,13 @@
function uuid_fpp_features_export_options() {
$options = array();
$query = 'SELECT f.fpid, f.admin_title, f.title, f.bundle, f.uuid
FROM {fieldable_panels_panes} f ORDER BY f.bundle, f.title ASC';
$results = db_query($query);
$query = db_select('fieldable_panels_panes', 'f')
->fields('f', array('fpid', 'admin_title', 'title', 'bundle', 'uuid'))
->orderBy('f.bundle', 'ASC')
->orderBy('f.title', 'ASC')
->addTag('uuid_fpp_features_export_options');
$results = $query->execute()->fetchAll();
foreach ($results as $fpp) {
$bundle_name = ucwords(str_replace('_', ' ', $fpp->bundle));
$display_title = ($fpp->admin_title) ? $fpp->admin_title : $fpp->uuid;
......
......@@ -24,7 +24,8 @@ function uuid_node_features_export_options() {
$query->fields('n', array('nid', 'title', 'type', 'uuid'))
->condition('type', $enabled_types)
->orderBy('type')
->orderBy('title');
->orderBy('title')
->addTag('uuid_node_features_export_options');
$nodes = $query->execute()->fetchAll();
foreach ($nodes as $node) {
$options[$node->uuid] = t('@type: @title', array(
......
......@@ -12,6 +12,7 @@ function uuid_nodequeue_item_features_export_options() {
$result = db_select('nodequeue_nodes', 'qn')
->fields('qn', array('qid', 'sqid', 'nid', 'position'))
->orderBy('position', 'ASC')
->addTag('uuid_nodequeue_item_features_export_options')
->execute();
while ($row = $result->fetchAssoc()) {
$queue = nodequeue_load($row['qid']);
......
......@@ -16,6 +16,7 @@ function uuid_panelizer_features_export_options() {
->isNull('name')
->groupBy('entity_type')
->groupBy('entity_id')
->addTag('uuid_panelizer_features_export_options')
->execute();
foreach ($results as $panelizer_entity) {
......
......@@ -17,6 +17,7 @@ function uuid_paragraphs_features_export_options() {
$efq_paragraphs_items = new EntityFieldQuery();
$efq_paragraphs_items->entityCondition('entity_type', 'paragraphs_item');
$efq_paragraphs_items->entityCondition('bundle', $enabled_bundles);
$efq_paragraphs_items->addTag('uuid_paragraphs_features_export_options');
$result = $efq_paragraphs_items->execute();
if (!empty($result['paragraphs_item'])) {
......
......@@ -26,6 +26,7 @@ function uuid_term_features_export_options() {
->addField('v', 'name', 'vname');
$query->orderBy('v.name', 'ASC');
$query->orderBy('t.name', 'ASC');
$query->addTag('uuid_term_features_export_options');
$results = $query->execute()->fetchAll();
foreach ($results as $term) {
......
......@@ -10,9 +10,13 @@
function uuid_user_features_export_options() {
$options = array();
$query = 'SELECT u.uid, u.name, u.mail, u.uuid
FROM {users} u WHERE uid > 0 ORDER BY u.name ASC';
$results = db_query($query);
$query = db_select('users', 'u')
->fields('u', array('uid', 'name', 'mail', 'uuid'))
->condition('u.uid', 0, '>')
->orderBy('u.name', 'ASC')
->addTag('uuid_user_features_export_options');
$results = $query->execute()->fetchAll();
foreach ($results as $user) {
$options[$user->uuid] = t('@name: @mail', array(
'@name' => $user->name,
......
Supports Markdown
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