Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Drupal debugging tips


Published on

Drupal debugging tips

  1. 1. DRUPAL DEBUGGING TIPS ==== DRUPAL DEBUGGING ==== 1. Access all available variables in page.tpl.php using devel module <?php dpm(get_defined_vars()); ?> 2. Inspect function calls <?php dpm(debug_backtrace()); ?> or just use <?php ddebug_backtrace(); ?> 3.) Use the debug() just like dpm() or dsm() in devel $label, $print_r); - FULL OPTIONS: debug($data, resource = <?php debug($form); ?> 4.) Development Tools (Logging) - 5.) How to debug and troubleshoot (sitebuilders) General advice - Clear caches - Check for Watchdog log messages - Look at the source code of the web page (Firebug) - Look at the data in the database If a module doesn't show up on the Module List - Check permission on the module's directory and files - Make sure the .module file exists - Make sure there aren't multiple copies of the .module file in sites/all/modules If a module doesn't seem to - Make sure you know what - Make sure the module is - Make sure the module is - Make sure any necessary - Lastly Clear the caches be doing anything the module is supposed to do installed (exists in sites/all/modules) enabled in the Module List sub-modules are enabled If a module doesn't seem to be doing the right thing - Make sure you have the right version of the module If content isn't showing up or you're denied access to it - Check permissions - Rebuild the node access table: administer > content management > post settings D7 - /admin/reports/status/rebuild If content isn't updating after you changed something - Clear caches Adolfo G. Nasol 09195951276
  2. 2. DRUPAL DEBUGGING TIPS References: - 6.) How to debug and troubleshoot (module developers) General advice - Check for PHP errors - Print some debugging information * drupal_set_message * watchdog * print * print_r * * - Print a backtrace * devel module -- drush vset devel_error_handler 2 * * If a module doesn't seem to be doing anything - Make sure all hook functions have the right name (<module name>_<hook name>) - Context > Debug reaction If you are having problem with Javascript - Use alert() or console.log() References - - SimpleTest -- - - Adolfo G. Nasol 09195951276