Blog Archives

Tideways and Xhgui using DevDesktop and Docker

THIS POST IS UNFINISHED. Use at your own risk. I needed to share with a colleague, so I’m just getting it out into the world. Your Mileage May Vary! I’ve been working on some large Drupal 8 migrations and have been wanting

Tagged with: , ,
Posted in Development

Setting up xdebug for PHP 7 in Acquia DevDesktop

The Acquia DevDesktop help page says: The PHP 7 version currently included with Acquia Dev Desktop does not currently include Xdebug. You can download an updated version of Xdebug here . Here are the actual steps I used. YMMV.

 

Tagged with: , , ,
Posted in Development

Extracting Image “src” Attributes from an HTML String using PHP

Here are a few ways to build an array of image sources extracted from an HTML string. I’m sure there are other ways, but these seem to be reliable.

Tagged with: ,
Posted in Development

Using Xdebug to Trace Functions

I’ve been relying on Xdebug quite a lot in recent years to step through PHP code, analyze stacktraces, inspect variables, profile applications, and more. Recently I needed to find out why a function call was taking so long to execute.

Tagged with: , , ,
Posted in Development

Drupal 7 – Commerce Migration Class

Here’s a migration class I’ve been working on to import 8200 products. The biggest feature of this code is that it will automatically create a single product display node that groups all products who share the same “grouping identifier.” So,

Tagged with: , , , ,
Posted in Development

Quick Tip: Adding a Reset button to a Drupal form

Using hook_form_alter or hook_form_FORM_ID_alter one can easily add a “Reset” button to a Drupal form. In this example we’re actually trying to reset anything the user typed after the form loaded. This will not remove the default values. Here’s a simple example (Drupal 6)

Tagged with: , , , ,
Posted in Development

Drupal Commerce Add To Cart Form Tweaks / Registration Improvements

In this example I’m showing how to improve the Add to Cart button for Drupal Commerce products to show differently based on whether or not users have already purchased a product, or whether the product is already in their cart.

Tagged with: , , , , ,
Posted in Development

Proximity by City or Zip Code in Drupal 6 with Location and Views

The location module for Drupal 6 is a robust module. On most projects, it gives us 100 percent of what we need. Proximity searching based on zip code is built-in and fairly painless to setup. I’ve recently been tasked to also allow

Tagged with: , , , , , , ,
Posted in Development

Get the Value of the Cheapest Option for an Ubercart Product

This is just a quick code example. Imaging you have an Ubercart attribute that has several options and you’d like to show an “As low as $X.XX” price on the frontend. Here’s a simple solution. Note that if you wanted

Tagged with: , , ,
Posted in Development