Thursday, September 29, 2011

Updating modules and themes requires FTP access to your server

How to get rid of that pesky (D7) FTP issue when updating modules:

Updating modules and themes requires FTP access to your server

http://drupal.org/documentation/install/modules-themes/modules-7#comment-4690140

The short of it, change the owner of the sites/default directory to whoever the Apache default user is (www-data, apache, etc.)

chown www-data sites/default

Monday, September 19, 2011

Debugging PHP in NetBeans (in Windows)


Here are the steps I used to setup PHP debugging in NetBeans (7.0 at the time of this writing).

The way to do it:  http://xdebug.org/docs/install
You will need to download the correct php_xdebug from the xdebug.org site: http://xdebug.org/download.php

I downloaded the correct DLL for my environment and followed the install instructions.  Below are my final php.ini settings:

This extension is disabled
;extension=php_xdebug.dll


[XDebug]
;; Only Zend OR (!) XDebug
;zend_extension_ts="D:\xampp\php\ext\php_xdebug.dll"
zend_extension_ts = "D:\xampp\php\ext\php_xdebug-2.1.1-5.2-vc6.dll"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="D:\xampp\tmp"


NetBeans PHP Debug Settings
  1. Goto tools->Options
  2. Select PHP
  3. On the General tab

Friday, September 2, 2011

Almost 3 Years!!!

Hey look, I've been a member of D.O for nearly 3 years now.  :)


Thursday, September 1, 2011

Drupal 6 - Remove N/A from list of Radio button options

When creating a radio button field with CCK, you can remove the "N/A" option by making the field required.

fyi...to make your options turn into checkboxes, change "Number of values" to something other than 1.

D6 - SIMPLE module to get JavaScript working on a form

The very quick and easy way to get some JavaScript working on your form:

  1. Add the 3 files below to your basic module structure.  This module is called "your_module" for example purposes.
  2. Enable the module
  3. Clear cache

your_module.info:
name = Demo Information
description = Custom handling of demo information
core = 6.x
package = Your Company


your_module.module:
<?php

/**
 * Implementation of hook_form_alter().
 */
function your_module_form_alter(&$form, $form_state, $form_id) {
  // Only include on WHATEVER node add/edit forms.  Adjust these lines based on your content types.
  if ($form_id == 'new_item_node_form') {
    drupal_add_js(drupal_get_path('module', 'your_module') .'/your_module.js');
  }
}


your_module.js:
alert("Gotcha!");



Look at the HTML source and you should see your_module.js listed within all the other JavaScript files.