Posts

Drupal7 vs Drupal8 hooks - reference

An excellent reference https://x-team.com/blog/drupal-8-hooks/

Set up Drupal7 to Drupal8 migration in simple steps (using Drush)

Step1: Download Drupal8 and its dependencies using composer Note: Drush8 is needed for migrate_upgrade module to execute. migrate_upgrade is not working with Drush9. >sudo composer create-project drupal-composer/drupal-project:~8.4 migrate843 --stability dev --no-interaction This will install drush and drupal-console Reference: https://www.drupal.org/docs/develop/using-composer/using-composer-to-manage-drupal-site-dependencies Step2: Install Drupal using Drush > sudo ../vendor/bin/drush site-install --db-url=mysql://username:password@host/dbname Step3: Enable migration related modules drush en migrate drush en migrate_drupal drush en migrate_tools drush en migrate_plus drush en migrate_upgrade Step4: Now run the migration. -- configure - only  option, which instead of running the migration will generate migration configuration entities, which may then be edited to customize the migration path and run using the  migrate_tools module ...

Drupal general concepts that you should know

Image
namespace: In simple terms,  think of a namespace as a person's surname . If there are two people named "John" you can use their surnames to tell them apart. https://stackoverflow.com/questions/3384204/what-are-namespaces Solve the issues of resuable code such as classes or functions. namespace example: the file  foo.txt  can exist in both directory  /home/greg  and in  /home/other , but two copies of  foo.txt  cannot co-exist in the same directory. In addition, to access the  foo.txt  file outside of the  /home/greg  directory, we must prepend the directory name to the file name using the directory separator to get  /home/greg/foo.txt . This same principle extends to namespaces in the programming world. Avoids namespace collisions Name collisions example:  you create a function named db_connect, and somebody elses code that you use in your file (i.e. an include) has the same functio...

Install Drush 8.x on Ubuntu 16.04

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');"  mv composer.phar /usr/local/bin/composer composer vim ~/.bashrc Add this => export PATH="$HOME/.composer/vendor/bin:$PATH" and ~/.bashrc source  ~/.bashrc composer global require drush/drush:8.x drush --version drush 7 version install ================ composer global require  drush / drush :7.1.0  export PATH="/root/.composer/vendor/b in:$PATH"

What GIT submodule update does

Your main project points to a particular commit that the submodule should be at. What  git submodule update  does is to try to checkout that commit in each submodule that has been initialized. The submodule is really an independent repository - just creating a new commit in the submodule and pushing that isn't enough, you also need to explicitly add the new version of the submodule in the main project. So, in your case, you should find the right commit in the submodule - let's assume that's the tip of master: cd mod git checkout master git pull origin master Now go back to the main project, stage the submodule and commit that: cd .. git add mod git commit -m "Updating the submodule 'mod' to the latest version" Now push your new version of the main project: git push origin master From this point on, if anyone else updates their main project, then  git submodule update  for them will update the submodule, assuming it's been initialized.

Docker

# Backup docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql # Restore cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE #create a container and link sudo docker run --name wordpress -p 8080:80 --link db_container -d wordpress here db_container is a database container

Saucelabs integration with codeception/codeceptjs

Some notes; 1. How to run Saucelabs proxy connect bin/sc -u YOUR_USERNAME -k YOUR_ACCESS_KEY bin> ./sc  YOUR_USERNAME -k YOUR_ACCESS_KEY