I've encountered an instance where the value of devel_xhprof_enabled was set to 'false' in the database (probably through drush vset). Since PHP interprets the string 'false' as being equivalent to TRUE, the devel module read the xhprof option as being set but the admin form (devel.admin.inc), expecting values of 1 or 0, displayed the checkbox as unchecked.

Granted, this is an edge case, but expanding to #default_value setting to use a ternary operator and explicitly set 1 or 0 would help avoid this kind of mismatch.

 $form['xhprof']['devel_xhprof_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable profiling of all page views and <a href="!drush">drush</a> requests.', array('!drush' => url('http://drush.ws'))),
    '#default_value' => variable_get('devel_xhprof_enabled', FALSE),
    '#description' => $description,
    '#disabled' => !extension_loaded('xhprof'),
  );

Comments

Barrett’s picture

Issue summary: View changes
Barrett’s picture

Status: Active » Closed (won't fix)

The commit immediately after the one which is tagged for the 1.5 release removes xhprof from this module, so I'm going to presume this is a "won't fix" issue.

dcf77278a96b1275cae5866970048f54c19f34ff Remove xhprof integration. Please use xhprof module. Or if you prefer a non-Drupal solution, see xhgui or xhprof.io
becb6ca3ced27872b941b30ca308da03a209425a (tag: refs/tags/7.x-1.5) Issue #2202887 by jonathan1055: For drupal_debug.txt use file_directory_temp() not 'temporary://'