This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_views_query_alter(). | |
*/ | |
function ramsalt_shy_replacement_views_query_alter(&$view, &$query) { | |
if ($view->name === 'frontpage_admin') { | |
foreach ($query->where[1]['conditions'] as $delta => $condition) { | |
if ($condition['field'] === 'node.title') { | |
$query->add_where_expression(1, "REPLACE(node.title, '=', '') " . $condition['operator'] . " '" . $condition['value'] . "'"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Boost published_at field to prioritize newer content. | |
* | |
* @see https://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_boost_the_score_of_newer_documents | |
* Implements hook_search_api_solr_query_alter(). | |
*/ | |
function my_module_search_api_solr_query_alter(array &$call_args, SearchApiQueryInterface $query) { | |
// Boost more recently created articles. Boost the field with score +8 shrinking during 365 days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drush config-export --skip-modules=devel,kint,stage_file_proxy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name SERVER_NAME; | |
listen 80; | |
root /var/www/html/; | |
index index.php; | |
fastcgi_keep_conn on; | |
fastcgi_index index.php; | |
fastcgi_param QUERY_STRING $query_string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Grunt file for Drupal theming, including clever drush cache clearing. | |
* | |
* Usage in docker4drupal environment: `grunt --docker` | |
* It ensures, that drush is executed from the php container. | |
*/ | |
module.exports = function (grunt) { | |
var drush_path = 'drush'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drush @live.example.org sql-dump --gzip|zcat|drush sql-cli |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/includes/commerce_product.inline_entity_form.inc b/includes/commerce_product.inline_entity_form.inc | |
index 5dcb6f2..62da0b6 100644 | |
--- a/includes/commerce_product.inline_entity_form.inc | |
+++ b/includes/commerce_product.inline_entity_form.inc | |
@@ -160,7 +160,7 @@ class CommerceProductInlineEntityFormController extends EntityInlineEntityFormCo | |
); | |
$entity_form['product_details'] = array( | |
'#type' => 'fieldset', | |
- '#title' => t('Details'), | |
+ '#title' => $this->getSetting('multi_edit') ? $product->title . ' (' . $product->sku . ')' : t('Details'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Aegir has major problems while migrating sites, when the new platform doesn't have the vendor libraries available. | |
## Here is a workaround for solving that problem. | |
## Copy the working site into the new platform. | |
## That needs to be done, to let composer_manager know about all the site package requirements | |
cp -r /var/aegir/platforms/old_platform/sites/site.name.org /var/aegir/platforms/new_platform/sites/site.name.org.migration | |
cd /var/aegir/platforms/new_platform | |
## Initialize composer_manager if not already done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
drush sql-dump --gzip --result-file=backup-xxxx.sql.gz --structure-tables-list=cache,cache_*,cache_filter,cache_form,cache_menu,cache_page,history,sessions,watchdog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function _load_header_image($variables) { | |
if ($node = $variables['node']) { | |
// Load main_image | |
$file = $node->field_main_image->entity; | |
if ($file) { | |
$variables = array( | |
'responsive_image_style_id' => 'header_image', | |
'uri' => $file->getFileUri(), |