http://drupal.org/node/59073 (porting DBA to 4.7) can't be resolved and the DRUPAL-4-7 branch can't be added until this FAPI conversion is done.

CommentFileSizeAuthor
#7 dba_4.7_settings.patch.txt11.68 KBdww
#5 dba_forms_47.patch9.93 KBgreggles

Comments

aam’s picture

I have tryed to update the settings page according to the new forms api: the page appears now, but some more testing needed:

function dba_settings() {
    if ( !user_access('dba administer database') ) {
	return message_access();
	}
  // Backups
  //$group = form_textfield(t('Default backup filename'), 'dba_default_filename', variable_get('dba_default_filename', 'backup.sql'), 45, 255, t('Default filename to use when backing up multiple tables.  If backing up only one table, the filename will default to the name of the table.  You will have an opportunity to modify this filename when you actually perform the backup.'));
  //$output = form_group(t('Database backup'), $group);
    $form['backup_options'] = array(
	'#type' => 'fieldset',
	'#title' => t('Database Backup'),
	'#collapsible' => TRUE,
	'#collapsed' => FALSE
	);
    $form['backup_options']['dba_default_filename'] = array(
	'#type' => 'textfield',
	'#title' => t('Default backup filename'),
	'#description' => t('Default filename to use when backing up multiple tables.  If backing up only one table, the filename will default to the name of the table.  You will have an opportunity to modify this filename when you actually perform the backup.'),
	'#default_value' => variable_get('dba_default_filename', 'backup.sql'),
	'#size' => 30,
	'#maxlength' => 64
	);

  // MySQL
  //$group = form_radios(t('Default check type'), 'dba_default_check_type', variable_get('dba_default_check_type', 'MEDIUM'), array('QUICK' => t('Quick'), 'FAST' => t('Fast'), 'CHANGED' => t('Changed'), 'MEDIUM' => t('Medium'), 'EXTENDED' => t('Extended')), t('MySQL databases support many types of database integrity checks.  Select your preferred default type from the list above.  Medium is the MySQL recommended default type.'));
  //$group .= form_radios(t('Repair option'), 'dba_repair', variable_get('dba_repair', 0), array('0' => t('Automatic'), '1' => t('Always'), '2' => ('Never')), t('By default, the dba module will only display a repair button if a table has been determined to need a repair.  Alternatively, you can make the module always display a repair button, or never display a repair button.'));
  //$output .= _is_mysql() ? form_group(t('MySQL table check & repair'), $group) : '';
  if ( _is_mysql() ) {
    $form['mysql_options'] = array(
	'#type' => 'fieldset',
	'#title' => t('MySQL table check & repair'),
	'#collapsible' => TRUE,
	'#collapsed' => FALSE
	);
    $form['mysql_options']['dba_default_check_type'] = array (
	'#type' => 'radios',
	'#title' => t('Default check type'),
	'#description' => t('MySQL databases support many types of database integrity checks.  Select your preferred default type from the list above.  Medium is the MySQL recommended default type.'),
	'#default_value' => variable_get('dba_default_check_type', 'MEDIUM'),
	'#options' => array('QUICK' => t('Quick'), 'FAST' => t('Fast'), 'CHANGED' => t('Changed'), 'MEDIUM' => t('Medium'), 'EXTENDED' => t('Extended'))
	);
    $form['mysql_options']['dba_repair'] = array (
	'#type' => 'radios',
	'#title' => t('Repair option'),
	'#description' => t('By default, the dba module will only display a repair button if a table has been determined to need a repair.  Alternatively, you can make the module always display a repair button, or never display a repair button.'),
	'#default_value' => variable_get('dba_repair', 0),
	'#options' => array('0' => t('Automatic'), '1' => t('Always'), '2' => ('Never'))
	);
    }

  return $form;
}
dww’s picture

can you please post a patch file against the current version of dba.module that accomplishes this?
http://drupal.org/patch
thanks,
-derek

aam’s picture

The dba settings page works in current cvs version too. No need to review this brute force conversion to Foms API..

aam’s picture

Status: Active » Postponed

Sorry, the status must be changed too.

greggles’s picture

Status: Postponed » Needs review
StatusFileSize
new9.93 KB

Here's a version of the information as a patch.

Also, the code in comment #1 was missing options related to path, zip, email, and exclusion so I added those back.

greggles’s picture

Also, when I use this in my xampp installation I get these errors on settings->save, but the page is still saved:

Warning: unlink(C:\xampplite\tmp\dba2AD.tmp) [function.unlink]: Permission denied in C:\workspace\drupal\includes\file.inc on line 467

Warning: Cannot modify header information - headers already sent by (output started at C:\workspace\drupal\includes\file.inc:467) in C:\workspace\drupal\includes\common.inc on line 266
dww’s picture

Assigned: Unassigned » dww
StatusFileSize
new11.68 KB

previous patch was fubar in many respects. here's a new version that seems to work. can i get a witness? ;)

greggles’s picture

I had two problems with this version:

1. the checkboxes at admin/database don't show up (I assume they should, but have never really seen them)
2. I tried outputting a bz backup, a regular backup, and I tried emailing the backup to me, but it never got produced. I'll wait and see if it just needs a few more cron runs to be sure.

Thanks for picking this back up, dww.

dww’s picture

re: #1 -- this is a totally separate (and much more difficult) issue: http://drupal.org/node/68500
re: #2 -- you mean the automated backup setting, or the manual backup UI?

honestly, i haven't seen if the underlying settings fully work, yet. ;) i was just trying to get the settings form itself functional again. i guess i should have tried to test the cron-stuff to make sure that's working, too. ;) needless to say, cron.php has to be running for that stuff to work.

anyway, thanks for the testing.
-derek

jeremy’s picture

Status: Needs review » Reviewed & tested by the community

The settings page appears to be fully functional with this patch. An automatic backup was created when I ran cron, however it was not mailed to me. Thus there appears to be a bug, but it is outside the scope of this patch and unrelated to the settings page.

I'm currently only worried about functionality, not looking very closely at the code. I'd really just like to see a release of the dba module for 4.7 that works. Please merge.

jeremy’s picture

FWIW: I finally did receive the backup via email, it just took longer than I expected. My email client didn't recognize the mime encoded attachment, but again that's unrelated to your patch.

dww’s picture

Status: Reviewed & tested by the community » Fixed

committed to HEAD as revision 1.41.

Anonymous’s picture

Status: Fixed » Closed (fixed)