Posts

Using Wodby (drupal4docker) to create our local development environment.

Image
Using Wodby https://wodby.com  to create a Drupal local development environment using docker. I have used the official Drupal docker image to create a local dev environment, it certainly does work but does not really tie in with how we currently use and develop on Drupal. I have checked Wodby drupal4docker and it seems to do what I expect and want the local dev environment. How to set this up Obviously there is a documentation on how to set this up https://wodby.com/docs/stacks/drupal/local/ even though the documentation is quite thorough I still struggled a bit so wanted to create a documentation for myself and anyone who happens to stumble on this link. My setup will consist of a local Drupal 8 code base with custom modules and themes, I save my code base in git including the Drupal code, this may not be really needed in the future as we are moving to using composer but for now I am sticking to keeping the Drupal codebase in my repository. I also ha

Add behat in Symfony 4

To add behat in Symfony 4 i have generally followed this link https://blog.rafalmuszynski.pl/how-to-configure-behat-with-symfony-4/ However i ran into problems so i thought of sharing this info. The steps are run composer req behat/behat --dev but stumbled on the following error: ~/work/thefootie-behat $ composer req behat/behat --dev Using version ^3.5 for behat/behat ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Restricting packages listed in "symfony/symfony" to "4.1.*" Your requirements could not be resolved to an installable set of packages.   Problem 1     - Installation request for behat/behat ^3.5 -> satisfiable by behat/behat[v3.5.0].     - behat/behat v3.5.0 requires symfony/class-loader ~2.1||~3.0 -> satisfiable by symfony/class-loader[3.4.x-dev] but these conflict with your requirements or minimum-stability. Installation faile

Update Drupal 8 DB to allow Updates to be run again for testing and dev purposes

When working with Drupal 7 and indeed Drupal 8 we may sometimes need to run updates (hook_update) again. In Drupal 7 updating system table should have been sufficient. In D8 things are a little bit different. Run a database update as follows: SELECT collection, name, substring(value, 1, 2500) FROM key_value WHERE collection="system.schema" and name="modulenameinquestion" The above will give us the last update hook that was run on this database. UPDATE key_value SET value = 'i:9999' where collection="system.schema" and name="modulenameinquestion" Hope this helps.

Use Behat BDD tests with Drupal 7

Image
Behat is a framework that allows us to write BDD tests, aka given-when-then tests. The language of test specification is quite simple and easy to read and is more business friendly, to know more about BDD you can go here  https://inviqa.com/blog/bdd-guide To use BDD with our drupal 7 site we need to go in the code base, create a folder under sites folder called behat. Installing Behat is done best using composer, so we need to create a composer.json file with the following content {   "require" : {     "drupal/drupal-extension" : "~3.0" },   "config" : {     "bin-dir" : "bin/"   } } and save as composer.json   Instructions are from  https://behat-drupal-extension.readthedocs.io/en/3.1/localinstall.html  adding starting steps or steps to make things clear. Assume composer is installed system wide (you can find better guides to install composer by searching on google). composer ins