Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Barrett CreditAttribution: Barrett commentedComment #2
Barrett CreditAttribution: Barrett commentedThe 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.