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
/** | |
* Clicks on a css element. | |
* | |
* @Given I click the :arg1 element | |
*/ | |
public function iClickTheElement($selector) { | |
$page = $this->getSession()->getPage(); | |
$element = $page->find('css', $selector); | |
if (empty($element)) { |
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
default: | |
suites: | |
default: | |
contexts: | |
- FeatureContext | |
- Drupal\DrupalExtension\Context\DrupalContext | |
- Drupal\DrupalExtension\Context\MinkContext | |
- Drupal\DrupalExtension\Context\MessageContext | |
- Drupal\DrupalExtension\Context\DrushContext | |
filters: |
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
Drupal.behaviors.myModule = { | |
attach: function (context, settings) { | |
}, | |
/** | |
* Explicitly save/update a url parameter using HTML5's replaceState(). | |
* | |
* @param {string} key | |
* Url param key. | |
* @param {string} 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 | |
// Manually update the field type in the database to `list_text`. | |
db_update('field_config') | |
->fields([ | |
'type' => 'list_text', | |
]) | |
->condition('field_name', 'field_some_field_name', '=') | |
->execute(); | |
// Update the field type from 'int' to 'varchar' and update length. |
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 | |
/** | |
* Good resources. | |
* | |
* https://www.triquanta.nl/blog/what-fq-short-summary-solr-query-fields | |
* https://lucene.apache.org/solr/guide/6_6/common-query-parameters.html | |
* http://valuebound.com/resources/blog/how-to-create-custom-solr-search-autocomplete-drupal-7 | |
*/ |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Listen for XDebug", | |
"type": "php", | |
"request": "launch", | |
"port": 9000, | |
"pathMappings": { | |
"/home/vagrant/docroot": "${workspaceRoot}/docroot", |
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
input.form-submit.button-small { | |
padding: 4px 8px; | |
font-weight: bold; | |
} | |
.container-inline input.form-submit.button-small + .ajax-progress.ajax-progress-throbber .throbber { | |
position: absolute; | |
left: 19px; | |
margin-top: 7px; | |
} |
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
// Apply redirect from old content to new content. | |
$old_alias = 'some/old/path'; | |
$new_alias = 'node/' . $node->nid; | |
$redirect = new stdClass(); | |
redirect_object_prepare($redirect); | |
$redirect->source = $old_alias; | |
$redirect->redirect = $new_alias; | |
redirect_save($redirect); |
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
/** | |
* Implements hook_page_alter(). | |
*/ | |
function mymodule_page_alter(&$page) { | |
if (!extension_loaded('newrelic')) { | |
return; | |
} | |
$name = NULL; |
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 | |
// https://steindom.com/articles/exporting-and-creating-field-definitions-drupal-7 | |
$entity_type = 'node'; | |
$field_name = 'field_name'; | |
$bundle_name = 'content_type'; | |
$info_config = field_info_field($field_name); | |
$info_instance = field_info_instance($entity_type, $field_name, $bundle_name); | |
unset($info_config['id']); |