Mario. Web Developer, Snowboarding Addict

tidbit

Error message

  • Notice: Undefined index: default_image in image_field_prepare_view() (line 207 of /home/drupal7/drupal-7.10/modules/image/image.field.inc).
  • Notice: Undefined index: default_image in image_field_prepare_view() (line 207 of /home/drupal7/drupal-7.10/modules/image/image.field.inc).
  • Notice: Undefined index: default_image in image_field_prepare_view() (line 207 of /home/drupal7/drupal-7.10/modules/image/image.field.inc).
  • Notice: Undefined index: default_image in image_field_prepare_view() (line 207 of /home/drupal7/drupal-7.10/modules/image/image.field.inc).
  • Notice: Undefined index: default_image in image_field_prepare_view() (line 207 of /home/drupal7/drupal-7.10/modules/image/image.field.inc).
  • Notice: Undefined index: default_image in image_field_prepare_view() (line 207 of /home/drupal7/drupal-7.10/modules/image/image.field.inc).
  • Notice: Undefined index: default_image in image_field_prepare_view() (line 207 of /home/drupal7/drupal-7.10/modules/image/image.field.inc).
  • Notice: Undefined index: default_image in image_field_prepare_view() (line 207 of /home/drupal7/drupal-7.10/modules/image/image.field.inc).
  • Notice: Undefined index: default_image in image_field_prepare_view() (line 207 of /home/drupal7/drupal-7.10/modules/image/image.field.inc).

Get CSV array from string in PHP5.2

Unfortunately the str_getcsv function doesn't exist in PHP < 5.3, and I really needed it for a particular project, and wasn't keen on writing my own version.

Turns out you can use the related function fgetcsv to similar effect using a bit of trickery to get your string as a resource stream first.

Tags:  tidbit php5.2

Drupal get raw SQL query

Drupal's database abstraction layer is pretty cool, but sometimes unexpected results on complicated queries can do your head in, so it's nice to be able to see the final SQL statement Drupal is planning on running.

Tags:  drupal7 tidbit mysql

Drupal embed node form in custom form

Embedding the node add/edit form is pretty easy, but what if you want a new and improved node form, with some of your excellent additions/modifications, without messing around with the core node//edit form?

Tags:  drupal7 tidbit

Drupal 'Undefined index: distribution_name' issue

Was migrating a few sites between Drupal-7.7 and Drupal-7.10 platforms and came across the following PHP notice:

Notice: Undefined index: distribution_name in drupal_install_profile_distribution_name() (line 202 of /srv/drupal-7.10/includes/install.inc).

Tags:  drupal7 tidbit

Git reset submodules

I'm managing a large number of git submodules on a particular project, and found their working directories often became dirty in various ways (i.e. file perms changing with an Aegir deployment).

Tags:  git tidbit

Growl/Email notifications for Irssi

I wanted to get notifications for mentions/messages on a remotely screened session of Irssi, and came across a cool notify.io irssi script.

Add custom view modes in Drupal 7

You can add extra display modes using hook_entity_info_alter.

Say you have a custom module 'myModule' and want to add a custom view to the node entity:

Tags:  tidbit drupal7

Ubuntu Install PECL uploadprogress Library

Drupal 6/7 make use of the PECL uploadprogress library for upload progress. This is how to install it.

Tags:  blog tidbit

Drupal: get nodes by type

It appears that if you're trying to get nodes by type in your Drupal module or theme (i.e. not on a page, in which case you should use Views) then a quick and easy way to get them is through an SQL query.

Tags:  tidbit drupal6