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
<?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
<?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
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
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
/** | |
* 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
/** | |
* @Given I log in as :name | |
*/ | |
public function iLogInAs($name) { | |
$domain = $this->getMinkParameter('base_url'); | |
// Pass base url to drush command. | |
$uli = $this->getDriver('drush')->drush('uli', array( | |
"'" . $name . "'", | |
"--browser=0", | |
"--uri=$domain", |
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
#local configuration | |
default: | |
extensions: | |
Behat\MinkExtension: | |
base_url: http://localdev.dev | |
sessions: | |
default: | |
goutte: | |
guzzle_parameters: | |
verify: false #get around ssl cert on local environment |
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
// https://www.drupal8.ovh/en/tutoriels/372/remove-uninstall-deleted-module-drupal-registry | |
drush sql-query "DELETE FROM key_value WHERE collection='system.schema' AND name='module_name';" |
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
// https://createdbycocoon.com/knowledge/get-media-video-url-twig-drupal-8 | |
Sometimes it may be useful to access the raw media file URL/URI value for a video file that has been uploaded via a Media field on an entity type. | |
In your Twig template, you may wish to display the raw URL of the file, rather than the embedded video or rendered entity as Drupal 8 natively provides. | |
It's really simple to access the raw URI. Simply use the following syntax in your Twig file (which will work for nodes, custom block templates, and paragraphs): | |
`{{ file_url(content.field_video[0]['#media'].field_media_video_file.entity.uri.value) }}` |