Outside Links collection sticky icon

Sometimes you find just the right resources that fulfill certain need and nothing much should be added to them, in those cases I will just collect them on this page and add short comment why is this so.

How to combine Git and Drush to have perfect workflow for site maintenance, information and examples are here

Setting upt perfect Git + Drush workflow, read here

Using CRUD with RESTful WS module

There is not much docs about this, but watching this video
will help you with testing your drupal site and RESTful WS and Advanced REST Client.

For more info, look this one
has all the drupal service modules in it and good examples how to use them.

One big GOTCHA is that.
X-CSRF-TOKEN is working on my localhost as

Running mysql on mamp localy

If you have more then one mysql installed on your computer and in your path is not proper MYSQL, you should run

/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot

to start MAMP mysql, and to check if the one you want to use is right, run show databases;
Kind of a newbee thing, but could help for Frontenders and people not so good with AMP stacks.

Can't find a string to translate in drupal

This is kind of odd solution as it will confuse people.

"The t() function, to save on performance for single-language sites, won't store the string in the database until it is requested from another language. View the page in one of the non-default languages in order to populate the database (t() calls locale() to do this), thus making the string available for translation."

what it means is that you wont find some string if it was never requested

1. When you create new string you need to visit it on other language page

Enable errors and logging with drush or with settings.php

You have error, your site is not accessable and you need to see what is the problem but logging and errors are set to none.
Type this with drush

drush vset error_level x

Where x is 0/1/2, depending on what you want

0: none
1: errors and warnings
2: all

You can also do the same with settings.php, adding to it this

$conf['error_level'] = 2;

Stdin: is not a tty and other GIT problems when git clone

stdin: is not a tty
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
remote: Counting objects: 7844, done.
error: git upload-pack: git-pack-objects died with error.
remote: fatal: Out of memory, calloc failed
remote: fatal: Out of memory, calloc failed
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.

Finding ib_logfile0, ib_logfile1 and ibdata1 on MAMP


You will need this files, probably to delete them on MAMP/MAMP PRO when changing your "innodb_log_file_size" in my.cnf
Right location is very hard to find it is /Library/Application Support/appsolute/MAMP PRO/db/mysql

Varnish makes forms like node add/edit "timeout" or not submit

I had a strange problem with Varnish, when users used form for longer period, like they inputed data and then submitted if it was 120 seconds or more, edit page would just refresh and nothing would be submitted. So I played with TTLs https://www.linode.com/docs/websites/varnish/getting-started-with-varnis..., then with pipe_timeout

Drupal commerce checkout redirect pause

When using different payment methods for checkout, sometimes you will have a payment gateway that will redirect you to different page, like paypal. But what if you want to have your frontender a chance to look at a page before redirect to style it?

You will need to stop the redirect, to do that just find that payment method info function in module, like the one below and change
'offsite_autoredirect' => TRUE, to 'offsite_autoredirect' => FALSE,

function commerce_payflow_commerce_payment_method_info() {
$payment_methods = array();

Git setup with hook for post-receive.

I have setup a simple git workflow.

In one directory on server I made bare repositroy

$ mkdir git-dir && cd git-dir
$ git init --bare

and in other one a folder for my live site

$ mkdir /var/www/www.example.com

then in the git-dir folder edit the post-receive hook

$ vi hooks/post-receive

and add this to file

GIT_WORK_TREE=/var/www/www.example.org git checkout -f

after that, make this file excutable

$ chmod +x hooks/post-receive