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/sh | |
| DISTRO='commerce_kickstart' | |
| NAME='Commerce Kickstart' | |
| # @todo use REST API to get https://www.drupal.org/api-d7/node/2729399.json but by checking type and field_release_vcs_label | |
| # this lets us know when it has been packaged. | |
| git fetch upstream && git merge upstream/master | |
| rm -rf profiles/$DISTRO |
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
| [ | |
| { | |
| "command": "settings", | |
| "settings": { | |
| "ajaxPageState": { | |
| "theme": "bartik", | |
| "libraries": "bartik\/global-styling,classy\/base,classy\/messages,color_field\/color-field-formatter-swatch,commerce\/drupal.commerce.toolbar,commerce_cart\/cart_block,commerce_product\/rendered-attributes,commerce_product\/rendered-attributes,contextual\/drupal.contextual-links,contextual\/drupal.contextual-toolbar,core\/drupal.active-link,core\/html5shiv,core\/normalize,quickedit\/quickedit,shortcut\/drupal.shortcut,system\/base,toolbar\/toolbar,toolbar\/toolbar.escapeAdmin,tour\/tour,user\/drupal.user.icons" | |
| }, | |
| "ajaxTrustedUrl": { | |
| "form_action_cc611e1d": true, |
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 example_helper_to_import_config_in_hook_update_N() { | |
| /** @var \Drupal\config_update\ConfigReverter $updater */ | |
| $updater = \Drupal::service('config_update.config_update'); | |
| try { | |
| $updater->import('commerce_product_type', 'dvds'); | |
| } | |
| catch (\Drupal\Core\Entity\EntityStorageException $e) { |
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_rebuild(). | |
| */ | |
| function mymodule_core_rebuild() { | |
| $collection = \Drupal\Core\Config\StorageInterface::DEFAULT_COLLECTION; | |
| $config_manager = \Drupal::service('config.manager'); | |
| $modules = ['custom_module1', 'custom_module2', 'custom_module3']; | |
| foreach ($modules as $module) { |
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
| about: | |
| command: about | |
| aliases: { } | |
| description: 'Display basic information about Drupal Console project' | |
| synopsis: about | |
| usages: { } | |
| help: null | |
| arguments: { } | |
| options: { } | |
| 'cache:rebuild': |
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
| > $ cd /path/to/your/fork | |
| > $ git remote add upstream [email protected]:MidCamp/midcamp-website.git | |
| > $ git fetch --prune upstream | |
| > $ git rebease upstream/develop | |
| > $ git push origin develop |
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_url_inbound_alter(). | |
| */ | |
| function muimodule_url_inbound_alter(&$path, $original_path, $path_language) { | |
| if (preg_match('/^(.*)\/news$/', $path, $matches)) { | |
| $node_path = $matches[1]; | |
| $conditions = array('alias' => $node_path); | |
| $actual_apth = path_load($conditions); |
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 | |
| /** | |
| * @file | |
| * Contains \Drupal\mymodule\Plugin\Block\Copyright | |
| */ | |
| namespace Drupal\mymodule\Plugin\Block; | |
| use Drupal\Core\Block\BlockBase; |
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
| (function ($) { | |
| Drupal.behaviors.datePicker = { | |
| attach: function (context, settings) { | |
| var $fieldDate = $('form-item-attributes-field-date', context); | |
| var $fieldDateSelect = $fieldDate.find('select', context); | |
| var $fieldDateOptions = $fieldDate.find('option', context); | |
| // Insert datepicker div | |
| $('<div id="datepicker" />').insertBefore('.form-item-attributes-field-date'); |
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 | |
| // HINDSIGHT: Don't use presave. You'd need save (right, that exists?) | |
| function mymodule_commerce_customer_profile_save($profile) { | |
| if (isset($profile->my_custom_boolean)) { | |
| // Okay so the field was set, or exists on this bundle. | |
| if (!empty($profile->my_custom_boolean[LANGUAGE_NONE][0])) { | |
| // Okay, we have a value (double check this var) | |
| variable_set('commerce_addressbook_defaults', $profile->id); | |
| } |