Archive for July 2013

How to fix git not ignoring files

If you already have files created is verycommon that when you include them to be excluded on .gitignore. Git will ignore them. For that do the following: git rm -r –cached . #This removes everything from the index, then just run: git add . #Commit it: git commit -m “.gitignore is now working”  

Read More

Change remote on Git

You will need it for example if you change your repository provider. git remote set-url origin ssh://newhost.com/usr/local/gitroot/myproject.git Other way is to Edit the .git/config file in your working directory. You should see something like: [remote “origin”] fetch = +refs/heads/*:refs/remotes/origin/* url = ssh://oldhost.com/usr/local/gitroot/myproject.git

Read More

Get Values from field collection on Drupal 7

Let’s supose you have an user with a field collection named “field_certification” and you have a field that references to a field called field_class_type. $myuser = user_load($user->uid); //Get certifications ids without entity interpretation $certifications_array = $myuser->field_certification[LANGUAGE_NONE];   In $certifications_array you will obtain ids taht do not match the terms, so you need to conver them…

Read More