Skip to main content
Joachim's blog

Main navigation

  • Home
  • About

Breadcrumb

  1. Home

drupal planet

By joachim, Wed, 06/11/2019 - 14:30

Debugging and Logging AJAX requests tests in Docksal

The hardest thing I find with tests is understanding errors. Every time I think I've got debugging output sorted, I find a new layer where it doesn't work, I've got nothing, and I'm in the dark with something that's crashing and I don't know why.

The first layer is simple: errors in your test code itself. For example, make a typo in your tests/src/Functional/MyTest.php and PHPUnit crashes and you see the error in the terminal.

Tags

  • debugging
  • tests
  • drupal planet
By joachim, Wed, 30/10/2019 - 13:08

Multi-site search using Feeds and SearchAPI

[This is an old post that I wrote for System Seed's blog and meant to put on my own too but it fell off my radar until now. It's also about Drupal 7, but the general principle still applies.]

Tags

  • drupal planet
  • search
  • Feeds
By joachim, Sat, 16/03/2019 - 20:44

Controlling multiple sites with Drush 9

Drush 9 has removed dynamic site aliases. Site aliases are hardcoded in YAML files rather than declared in PHP. Sadly, that means that many tricks you could do with the declaration of the site aliases are no longer available.

The only grouping possible is based on the YAML filename. So for example, with the Acquia Cloud Site Factory site aliases generated by the 'blt recipes:aliases:init:acquia' command, you can run a command on the same site across different environments.

But what you can't do is run a command on all the sites in one environment.

Tags

  • Drush
  • drupal planet
By joachim, Thu, 27/11/2014 - 08:39

A git-based patch workflow for drupal.org (with interdiffs for free!)

There's been a lot of discussion about how we need github-like features on d.org. Will we get them? There's definitely many improvements in the pipeline to the way our issue queues work. Whether we actually need to replicate github is another debate (and my take on it is that I don't think we do).

Tags

  • git
  • drupal planet
  • issue queue
  • patching
By joachim, Sun, 28/10/2012 - 09:55

Corralling permissions into a grid

I've just released Permissions Grid. It does what the name suggests: it presents related permissions in a grid, rather than the usual long list.

Tags

  • drupal planet
  • permissions
  • drupal
  • drupal commerce
By joachim, Fri, 21/09/2012 - 19:47

On rules versus hooks, or, abstraction shock

I need to add a bit of business logic to my Commerce site: a boolean field on product nodes marks that the corresponding products can't be delivered outside the UK.

And I know the way to do this in Commerce is to create a rule: react to the cart completing checkout, iterate over line items, check the corresponding products, and block the completion if the field in question is set.

Tags

  • rules
  • drupal planet
  • drupal commerce
By joachim, Tue, 10/07/2012 - 19:20

Git tricks: repatching for an issue branch

My workflow for making patches is to use a feature branch for a single issue. Whether you're a contributor or a maintainer it lets you advance the fixing of the problem in small increments, and safely experiment knowing you can roll back.

But where it goes wrong is when your patch is superseded by a newer one in the issue queue, and you want to work on it some more. How do you update your branch for the ongoing work? As ever, with git there's a way.

Tags

  • drupal planet
  • git
  • issue queue
  • patching
  • drupal
By joachim, Fri, 06/07/2012 - 08:30

Git tricks: being on the wrong branch

I often find that I'm in the middle of one thing when I have to do another. Whether it's hotfixes for a client, or just finding a minor bug that blocks my current work, or needing to add components to a feature before I can add custom functionality.

The best way is to stash your current work, checkout the master branch, commit, then go back. If you're working on a feature branch (and you should be), then rebase that afterwards so you have access to the new work there. So that's:

Tags

  • drupal planet
  • git
By joachim, Thu, 03/05/2012 - 07:41

Get out, git!

There are lots of good reasons to have your server's codebase be an actual git checkout. But there's one potential flaw: your entire repository's history ends up in your webroot inside a .git folder.

You can block access to it in your .htaccess, but that's hacking core (until this patch lands at least).

There is however an alternative method that lets you keep the entirety of git's working folder outside the webroot completely.

Here's how to convert an existing repository to this format:

Tags

  • git
  • drupal planet
  • security
By joachim, Fri, 24/02/2012 - 10:32

Moving a git local branch from one local to another

You're maybe at one of the many Drupal Co-worker Friday events that are taking place around the world today. You've packed up your laptop and your lunchbox, and you're looking forward to a day out of the house with some human contact.

Tags

  • drupal
  • drupal planet
  • git

Pagination

  • 1
  • Next page
drupal planet

Frequent tags

  • Drupal Code Builder (9)
  • git (7)
  • module builder (6)
  • 6.x (5)
  • drupal commerce (4)
  • Field API (3)
  • patching (3)
  • Composer (3)
  • Drush (3)
  • development (3)
  • Entity API (3)
  • tests (2)
  • multisite (2)
  • issue queue (2)
  • Drupal core (2)
  • core (2)
  • modules (2)
  • roadmap (2)
  • 7.x (2)
  • developer tools (2)
  • Rector (2)
  • wtf (2)
  • contributing code (2)
  • maintaining projects (2)
  • code style (2)
  • contrib module (2)
  • drupal.org (2)
  • debugging (2)
Powered by Drupal