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', 'blog') | |
| ->propertyCondition('status', 1) | |
| ->propertyOrderBy('created', 'DESC') | |
| ->fieldCondition('field_journal_carousel_image', 'fid', 0, '!=') | |
| ->range(0, 10); | |
| $query->propertyCondition('language', array($GLOBALS['language']->language, LANGUAGE_NONE), 'IN'); |
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
| assuming you have a text field which machine name is field_text of 10 characters you want to grow to 25: | |
| data will be stored in two tables: field_data_field_text and field_revision_field_text | |
| definition is stored in field_config for the storage data, and field_config_instance for each instance of this field (stuff like label). | |
| Now let's do a little heart surgery. | |
| Alter the data tables columns definitions: | |
| ALTER TABLE `field_data_field_text` | |
| CHANGE `field_text_value` `field_text_value` VARCHAR( 25 ) |
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
| $node_type = 'product'; | |
| // Select the nodes that we want to delete. | |
| $result = db_select('node', 'n') | |
| ->fields('n', array('nid')) | |
| ->condition('type', $node_type, '=') | |
| ->range(0,5) | |
| ->execute(); | |
| $deleted_count = 0; |
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
| :setlocal noautoindent |
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
| git diff --name-only SHA1 SHA2 | xargs tar -cvzf myFile.tar.gz | |
| Where SHA1 is first revision and SHA2 is last revision. |
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://drupal.org/node/1619154#comment-6219918 |