This file contains 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/bash | |
drush sqlq "SELECT DISTINCT(SELECT name from users where uid = ur.uid) FROM users_roles AS ur WHERE ur.rid IN (4) LIMIT 50" | while read username; | |
do | |
echo "Updating Password for Users $username" | |
drush upwd $username --password='Pass@123' | |
# or do whatever with individual element of the array | |
done |
This file contains 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
Feature: Behat tests for a clean install of the Drupal 8 standard profile. These | |
tests are meant both to verify the Drupal install as well as Behat test features | |
(like API access and JavaScript handling). | |
Scenario: Ensure the Login link is available for anonymous users. | |
Given I am an anonymous user | |
When I am on the homepage | |
And I click "Log in" | |
Then I should see an "input#edit-name" element |
This file contains 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
$node_wrapper = entity_metadata_wrapper('node', $nodes); | |
$raw_collection = $node_wrapper->field_testp->value(); | |
foreach ($node_wrapper->field_test as $key => $field_collection_wrapper) { | |
$collection = new ParagraphsItemEntity(array('field_name' => 'field_testp', 'bundle' => 'paratest')); | |
$collection->is_new = TRUE; | |
$collection->setHostEntity('node', $nodes); | |
$field_collection = $field_collection_wrapper->value(); | |
if (isset($field_collection->field_test1['und'][0]['value'])) { | |
$collection->field_ptest1 = $field_collection->field_test1; | |
} |
This file contains 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 "_update_cache_clear()" | |
drush rf | |
drush up drupal |
This file contains 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 php-eval 'node_access_rebuild();' |
This file contains 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 | |
$query = new EntityFieldQuery(); | |
$result = $query->entityCondition('entity_type', 'node')->entityCondition('bundle', 'article')->execute(); | |
$nodes = node_load_multiple(array_keys($result['node'])); | |
foreach ($nodes as $loaded_node) { | |
node_access_acquire_grants($loaded_node); | |
} | |
?> |
This file contains 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 | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
$host = 'localhost'; | |
$dbuser = 'root'; | |
$dbpass = 'admin32'; | |
$db = 'drupal7_4'; |
This file contains 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
DELIMITER $$ | |
CREATE TRIGGER trigger1 | |
BEFORE DELETE | |
ON table1 | |
FOR EACH ROW | |
BEGIN | |
IF OLD.id = 1 THEN -- Abort when trying to remove this record | |
CALL cannot_delete_error; -- raise an error to prevent deleting from the table | |
END IF; |
This file contains 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 | |
rules_invoke_component('rules_send_notification_mail', $node, 'paramval2'); | |
?> |
This file contains 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
//mysql export | |
mysqldump --opt --max_allowed_packet=512M -u root -p np_bo > np_bo_dumpxx.sql | |
//mysql import | |
mysql --max_allowed_packet=512M -u username -p db < sqlfile.sql |
OlderNewer