where do I see errors when I write modules?

satya - Thursday, June 02, 2011 3:44:36 PM

drupal dpm example

drupal dpm example

Search for: drupal dpm example

satya - Thursday, June 02, 2011 3:45:00 PM

how to debug drupal

how to debug drupal

satya - Thursday, June 02, 2011 3:52:02 PM

Here is an example of using watchdog


function satya_test_module_custom_theme() {

  $current_theme = variable_get('theme_default','none');
  watchdog("curtheeme",$current_theme);
  
  $path = $_GET['q'];
  $pos = strpos($path, 'satyatest'); 
  watchdog("position","p:" + $pos);
  if( $pos === 0) {
    watchdog("Switching to bartik", $path);
    return 'bartik';
  }
  else
  {
     return $current_theme;
  }
}

Use extreme caution as I am totally new to php and drupal in adapting some of these early examples.

satya - Friday, July 15, 2011 2:00:29 PM

You can use dpm like this


function theme_satya_test_render_array($data)
{
  dpm($data);
  $d1 = $data[0]['d1'];
  return "Hello from render. and that.bbbb";
}

The $data variable will be printed in a block at the top of the page when that page is displayed. Or when you access the site next if this attempt fails.