This error might be very frustrating to you, specially when you can't see any issue with your code, can't check error log, and obviously can't do drush watchdog-show. After some search and investigation, found that I had a call to drupal_goto() in an implementation for hook_init() which is implemented on every bootstrap process. The solution … Continue reading Drush command terminated abnormally due to an unrecoverable error
Wrong execution of rsync command can result a mess that you may cost you some precious time to fix later, so you can test the rsync command before already executing it using the (-n) parameter or (--dry-run): rsync -anv path/to/file/with/trailing/slash/ path/to/file/without/trailing/slash Then you can execute it by removing the dry run parameter: rsync -av path/to/file/with/trailing/slash/ … Continue reading How to test RSYNC before already syncing
How to select all tables that has a column / columns: SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN ('column1','column2') AND TABLE_SCHEMA='database_name';
Occasionally you are in the situation that you need to know which files were changed from a commit to commit either to check an issue or to deploy these changes. git diff --name-only SHA1 SHA2 git diff --name-only HEAD~10 HEAD~5 Source
I had an issue with a custom node edit menu callback, that when the remove button is clicked to replace the current uploaded image, the whole widget disappears. I already loaded node.pages.inc file as follows: module_load_include('inc', 'node', 'node.pages'); BUT, apparently you should add these line to the menu item array: 'file path' => drupal_get_path('module', 'node'), 'file' => 'node.pages.inc', … Continue reading Drupal: Custom node edit menu callback, image upload widget disappears when change file
You can Add this code in your ~/.bashrc file to view the current branch in your project like function parse_git_branch () { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } RED="\[\033[0;31m\]" YELLOW="\[\033[0;33m\]" GREEN="\[\033[0;32m\]" NO_COLOR="\[\033[0m\]" PS1="$GREEN\u@\h$NO_COLOR:\w$YELLOW\$(parse_git_branch)$NO_COLOR\$ " Now your terminal will look like the following on a directory that … Continue reading Show which git branch you are using on terminal
I had an issue when I was trying to create a new display and tried to theme it, I found the "Row style output" template suggestions like the following and with no template content: Row style output: .tpl.php, --display.tpl.php, --type.tpl.php, ... After some investigation, I found that the reason that caused this that my … Continue reading Drupal7 Views3: Empty “Row style output” templates
//stop submitting form on pressing enter key //This code will allow enter key on textarea function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) {return false;} } document.onkeypress = stopRKey;
To get locked table you can use: show open tables WHERE In_use > 0 To get locked table in database (for ex.: database name: test_db) show open tables FROM test_db WHERE In_use > 0 To check whether or not a table is locked show open tables FROM test_db WHERE Table LIKE 'tb_employees' AND … Continue reading MySQL: Get locked tables
To add a custom currency paste this code in your theme functions.php file or in a complementary plugin for WooCommerce and swap out the currency code and symbol with your own. After doing so it will be available from WooCommerce settings. add_filter( 'woocommerce_currencies', 'add_my_currency' ); function add_my_currency( $currencies ) { $currencies['ABC'] = __( 'Currency name', 'woocommerce' ); return … Continue reading WordPress: WooCommerce: Add a custom currency / symbol