- edit the composer.json file to add a patch.
"extra": {
"enable-patching": true,
"patches": {
"drupal/core": {
"<patch1 information>": "<patch1 file path>",
"<patch2 information>": "<patch2 file path>"
}
"extra": {
"enable-patching": true,
"patches": {
"drupal/core": {
"<patch1 information>": "<patch1 file path>",
"<patch2 information>": "<patch2 file path>"
}
| <?php | |
| /** | |
| * Sets an id for the first iframe situated in the element specified by id. | |
| * Needed when wanting to fill in WYSIWYG editor situated in an iframe without identifier. | |
| * | |
| * @Given /^the iframe in element "(?P<element>[^"]*)" has id "(?P<id>[^"]*)"$/ | |
| */ | |
| public function theIframeInElementHasId($element_id, $iframe_id) { | |
| $function = <<<JS |
| { | |
| "info": { | |
| "_postman_id": "327e8396-b20c-49f7-8827-214aaa11203c", | |
| "name": "GAO API for PR Tests", | |
| "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
| }, | |
| "item": [ | |
| { | |
| "name": "GAO Product Post", | |
| "request": { |
| use Drupal\migrate\Plugin\MigrationInterface; | |
| use Drupal\migrate\Plugin\MigrateSourceInterface; | |
| use Drupal\migrate\Row; | |
| /** | |
| * Implements hook_migrate_prepare_row(). | |
| */ | |
| function YOUR_MODULE_migrate_prepare_row(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) { | |
| switch ($migration->id()) { | |
| case 'config_name': |
| <?php | |
| namespace Drupal\migrate_custom\Plugin\migrate\source; | |
| use Drupal\Core\Database\Query\Condition; | |
| use Drupal\migrate\Row; | |
| use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity; | |
| /** | |
| * Drupal 7 file source from database. |
| <?php | |
| // Import arbitrary config from a variable. | |
| $config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html'); | |
| $config->setData($data)->save(); | |
| // Or, re-import the default config for a module or profile, etc. | |
| \Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module'); | |
| // Or, import YAML config an arbitrary directory. |
| <?php | |
| /** | |
| * Implements hook_search_api_solr_converted_query_alter(). | |
| * | |
| * Modifies Solarium query to group results by field. | |
| * Modifies Solarium query to sort results by first geofield value within the multivalue field. | |
| */ | |
| function MODULE_search_api_solr_converted_query_alter(\Solarium\Core\Query\QueryInterface $solarium_query, \Drupal\search_api\Query\QueryInterface $query) { | |
| // Alter the Solarium query. |
contents of the theme/preprocess/README.md
Rather than placing your preprocess hooks directly in the .theme file you can manage them in automatically discovered and lazy-loaded include files. It is even possible to organize them in sub-folders. This feature greatly improves the maintainability of large themes that would otherwise contain hundreds of lines of unrelated code in your template.php file.
| <?php | |
| namespace Drupal\my_module\Services; | |
| use Drupal\Core\Config\ConfigFactory; | |
| /** | |
| * Class MyService. | |
| * | |
| * @package Drupal\my_module\Services |