mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
ENHANCEMENT UserFormsMigrationTask fixes to remove SQL and use the ORM instead
This commit is contained in:
parent
717139bfae
commit
876f2c5c57
@ -35,7 +35,8 @@ class UserFormsMigrationTask extends MigrationTask {
|
||||
*/
|
||||
function run($request) {
|
||||
// load the forms
|
||||
$forms = DataObject::get("UserDefinedForm");
|
||||
$forms = DataObject::get('UserDefinedForm');
|
||||
if(!$forms) $forms = new DataObjectSet();
|
||||
|
||||
// set debugging / useful test
|
||||
$this->dryRun = (isset($_GET['dryRun'])) ? true : false;
|
||||
@ -47,7 +48,7 @@ class UserFormsMigrationTask extends MigrationTask {
|
||||
// if they want to import just 1 form - eg for testing
|
||||
if(isset($_GET['formID'])) {
|
||||
$id = Convert::raw2sql($_GET['formID']);
|
||||
$forms = DataObject::get("UserDefinedForm", "UserDefinedForm.ID = '$id'");
|
||||
$forms->push(DataObject::get_by_id('UserDefinedForm', $id));
|
||||
}
|
||||
|
||||
if(!$forms) {
|
||||
|
Loading…
Reference in New Issue
Block a user