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 MYMODULE_form_user_register_form_alter(&$form, &$form_state, $form_id) { | |
| $form['account']['pass']['#process'] = array( | |
| 'form_process_password_confirm', | |
| 'MYMODULE_password_confirm_process', | |
| 'user_form_process_password_confirm' | |
| ); | |
| } | |
| function MYMODULE_password_confirm_process($element) { | |
| $element['pass1']['#attributes']['title'] = 'Title'; |
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
| $query = new EntityFieldQuery(); | |
| $query->entityCondition('entity_type', 'node') | |
| ->propertyCondition('type', 'feasibility_plan') | |
| ->propertyCondition('uid', $uid) | |
| ->addTag('DANGEROUS_ACCESS_CHECK_OPT_OUT'); | |
| if ($personal_view) { | |
| $query->fieldCondition('field_show_in_student_record', 'value', 1, '='); | |
| } | |
| $res = $query->execute(); |
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
| $config = \Drupal::service('config.factory')->getEditable('domain.config.three_d8_test.system.site'); | |
| $config->set('name', 'trest'); | |
| $config->save(); |
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
| $config = \Drupal::service('config.factory')->getEditable("domain.config.{$domain_machine_name}.omni_magazine.settings"); | |
| $config->set('logo', array('use_default' => FALSE, 'path' => drupal_realpath($file->getFileUri()))); | |
| $config->save(); |
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
| $form_state->getFormObject()->getEntity(); |
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 upwd host --password=123 |
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.security_questions_popup = { | |
| attach: function(context, settings) { | |
| var need_add_questions = Drupal.settings.global.need_add_security_questions; | |
| if (need_add_questions) { | |
| $(window).bind('load', function() { | |
| $('.security_questions_hide_link').click(); | |
| }); | |
| } | |
| } |
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_entity_info_alter(). | |
| */ | |
| function cba_webinar_entity_info_alter(&$entity_info) { | |
| // Update webinar event path. | |
| $entity_info['event']['bundles']['webinar']['crud']['add']['path'] = 'event/webinar/add'; | |
| $entity_info['event']['bundles']['webinar']['crud']['edit']['path'] = 'event/webinar/%eckentity/edit'; | |
| $entity_info['event']['bundles']['webinar']['crud']['delete']['path'] = 'event/webinar/%eckentity/delete'; | |
| } |
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 ev "echo drupal_get_installed_schema_version('bendrijusistema')"; | |
| drupal_set_installed_schema_version('bendrijusistema', 8001); | |
| drupal_get_installed_schema_version('bendrijusistema'); |
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
| /** | |
| * Get currency symbol. | |
| * | |
| * @param object $product_variation | |
| * @return string | |
| */ | |
| public function getCurrencySymbol($product_variation) { | |
| $currency_code = $product_variation->get('price')->currency_code; | |
| $currency = Currency::load($currency_code); |