From 81df2ba9aed69ef184ebe6fb4f1f2f1cf560ca83 Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Mon, 23 Sep 2019 11:54:59 +0530 Subject: Add ob_clean and ob_flush functions to download zip file --- full_download.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/full_download.inc b/full_download.inc index a8e7173..d6a9af4 100755 --- a/full_download.inc +++ b/full_download.inc @@ -106,6 +106,8 @@ function lab_migration_download_full_experiment() header('Content-Length: ' . filesize($zip_filename)); readfile($zip_filename); unlink($zip_filename); + ob_clean(); + ob_flush(); } else { @@ -116,7 +118,7 @@ function lab_migration_download_full_experiment() function lab_migration_download_full_lab() { $lab_id = arg(3); - var_dump($lab_id); + //var_dump($lab_id); //die; $root_path = lab_migration_path(); $APPROVE_PATH = 'APPROVED/'; @@ -151,6 +153,7 @@ function lab_migration_download_full_lab() $solution_q = $query->execute(); while ($solution_row = $solution_q->fetchObject()) { + //var_dump($solution_row); $CODE_PATH = 'CODE' . $solution_row->code_number . '/'; //$solution_files_q = db_query("SELECT * FROM {lab_migration_solution_files} WHERE solution_id = %d", $solution_row->id); /*$query = db_select('lab_migration_solution_files'); @@ -165,6 +168,7 @@ function lab_migration_download_full_lab() $solution_dependency_files_q = $query->execute(); while ($solution_files_row = $solution_files_q->fetchObject()) { + //var_dump($solution_files_row);die; $zip->addFile($root_path . $solution_files_row->directory_name. '/' . $solution_files_row->filepath, $APPROVE_PATH . $EXP_PATH . $CODE_PATH . $solution_files_row->filename); } /* dependency files */ -- cgit From 6de418022dc45f0695723b07b4fb5f4321d8d616 Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Mon, 23 Sep 2019 19:17:13 +0530 Subject: Remove unnecessary code --- full_download.inc | 110 +++--------------------------------------------------- 1 file changed, 5 insertions(+), 105 deletions(-) diff --git a/full_download.inc b/full_download.inc index d6a9af4..bda993d 100755 --- a/full_download.inc +++ b/full_download.inc @@ -7,7 +7,6 @@ function lab_migration_download_full_experiment() $APPROVE_PATH = 'APPROVED/'; $PENDING_PATH = 'PENDING/'; /* get solution data */ - //$experiment_q = db_query("SELECT * FROM {lab_migration_experiment} WHERE id = %d", $experiment_id); $query = db_select('lab_migration_experiment'); $query->fields('lab_migration_experiment'); $query->condition('id', $experiment_id); @@ -20,7 +19,6 @@ function lab_migration_download_full_experiment() $zip = new ZipArchive; $zip->open($zip_filename, ZipArchive::CREATE); /* approved solutions */ - //$solution_q = db_query("SELECT * FROM {lab_migration_solution} WHERE experiment_id = %d AND approval_status = 1", $experiment_id); $query = db_select('lab_migration_solution'); $query->fields('lab_migration_solution'); $query->condition('experiment_id', $experiment_id); @@ -29,36 +27,13 @@ function lab_migration_download_full_experiment() while ($solution_row = $solution_q->fetchObject()) { $CODE_PATH = 'CODE' . $solution_row->code_number . '/'; - //$solution_files_q = db_query("SELECT * FROM {lab_migration_solution_files} WHERE solution_id = %d", $solution_row->id); - /*$query = db_select('lab_migration_solution_files'); - $query->fields('lab_migration_solution_files'); - $query->condition('solution_id', $solution_row->id); - $solution_files_q = $query->execute();*/ $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.id = :solution_id", array(':solution_id' => $solution_row->id)); - //$solution_dependency_files_q = db_query("SELECT * FROM {lab_migration_solution_dependency} WHERE solution_id = %d", $solution_row->id); - $query = db_select('lab_migration_solution_dependency'); - $query->fields('lab_migration_solution_dependency'); - $query->condition('solution_id', $solution_row->id); - $solution_dependency_files_q = $query->execute(); while ($solution_files_row = $solution_files_q->fetchObject()) { $zip->addFile($root_path . $solution_files_row->directory_name. '/' . $solution_files_row->filepath, $APPROVE_PATH . $EXP_PATH . $CODE_PATH . $solution_files_row->filename); } - /* dependency files */ - while ($solution_dependency_files_row = $solution_dependency_files_q->fetchObject()) - { - // $dependency_file_data = (db_query("SELECT * FROM {lab_migration_dependency_files} WHERE id = %d LIMIT 1", $solution_dependency_files_row->dependency_id))->fetchObject(); - $query = db_select('lab_migration_dependency_files'); - $query->fields('lab_migration_dependency_files'); - $query->condition('id', $solution_dependency_files_row->dependency_id); - $query->range(0, 1); - $dependency_file_data = $query->execute()->fetchObject(); - if ($dependency_file_data) - $zip->addFile($root_path . $dependency_file_data->filepath, $APPROVE_PATH . $EXP_PATH . $CODE_PATH . 'DEPENDENCIES/' . $dependency_file_data->filename); - } } /* unapproved solutions */ - // $solution_q = db_query("SELECT * FROM {lab_migration_solution} WHERE experiment_id = %d AND approval_status = 0", $experiment_id); $query = db_select('lab_migration_solution'); $query->fields('lab_migration_solution'); $query->condition('experiment_id', $experiment_id); @@ -67,34 +42,11 @@ function lab_migration_download_full_experiment() while ($solution_row = $solution_q->fetchObject()) { $CODE_PATH = 'CODE' . $solution_row->code_number . '/'; - //$solution_files_q = db_query("SELECT * FROM {lab_migration_solution_files} WHERE solution_id = %d", $solution_row->id); - /*$query = db_select('lab_migration_solution_files'); - $query->fields('lab_migration_solution_files'); - $query->condition('solution_id', $solution_row->id); - $solution_files_q = $query->execute();*/ - $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.id = :solution_id", array(':solution_id' => $solution_row->id)); - - //$solution_dependency_files_q = db_query("SELECT * FROM {lab_migration_solution_dependency} WHERE solution_id = %d", $solution_row->id); - $query = db_select('lab_migration_solution_dependency'); - $query->fields('lab_migration_solution_dependency'); - $query->condition('solution_id', $solution_row->id); - $solution_dependency_files_q = $query->execute(); + $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.soultion_id = :solution_id", array(':solution_id' => $solution_row->id)); while ($solution_files_row = $solution_files_q->fetchObject()) { $zip->addFile($root_path . $solution_files_row->directory_name . '/' . $solution_files_row->filepath, $PENDING_PATH . $EXP_PATH . $CODE_PATH . $solution_files_row->filename); } - /* dependency files */ - while ($solution_dependency_files_row = $solution_dependency_files_q->fetchObject()) - { - // $dependency_file_data = (db_query("SELECT * FROM {lab_migration_dependency_files} WHERE id = %d LIMIT 1", $solution_dependency_files_row->dependency_id))->fetchObject(); - $query = db_select('lab_migration_dependency_files'); - $query->fields('lab_migration_dependency_files'); - $query->condition('id', $solution_dependency_files_row->dependency_id); - $query->range(0, 1); - $dependency_file_data = $query->execute()->fetchObject(); - if ($dependency_file_data) - $zip->addFile($root_path . $dependency_file_data->filepath, $PENDING_PATH . $EXP_PATH . $CODE_PATH . 'DEPENDENCIES/' . $dependency_file_data->filename); - } } $zip_file_count = $zip->numFiles; $zip->close(); @@ -118,13 +70,9 @@ function lab_migration_download_full_experiment() function lab_migration_download_full_lab() { $lab_id = arg(3); - //var_dump($lab_id); - //die; $root_path = lab_migration_path(); $APPROVE_PATH = 'APPROVED/'; $PENDING_PATH = 'PENDING/'; - /* get solution data */ - //$lab_q = db_query("SELECT * FROM {lab_migration_proposal} WHERE id = %d", $lab_id); $query = db_select('lab_migration_proposal'); $query->fields('lab_migration_proposal'); $query->condition('id', $lab_id); @@ -137,7 +85,6 @@ function lab_migration_download_full_lab() $zip = new ZipArchive; $zip->open($zip_filename, ZipArchive::CREATE); /* approved solutions */ - //$experiment_q = db_query("SELECT * FROM {lab_migration_experiment} WHERE proposal_id = %d", $lab_id); $query = db_select('lab_migration_experiment'); $query->fields('lab_migration_experiment'); $query->condition('proposal_id', $lab_id); @@ -145,7 +92,6 @@ function lab_migration_download_full_lab() while ($experiment_row = $experiment_q->fetchObject()) { $EXP_PATH = 'EXP' . $experiment_row->number . '/'; - //$solution_q = db_query("SELECT * FROM {lab_migration_solution} WHERE experiment_id = %d AND approval_status = 1", $experiment_row->id); $query = db_select('lab_migration_solution'); $query->fields('lab_migration_solution'); $query->condition('experiment_id', $experiment_row->id); @@ -153,39 +99,15 @@ function lab_migration_download_full_lab() $solution_q = $query->execute(); while ($solution_row = $solution_q->fetchObject()) { - //var_dump($solution_row); $CODE_PATH = 'CODE' . $solution_row->code_number . '/'; - //$solution_files_q = db_query("SELECT * FROM {lab_migration_solution_files} WHERE solution_id = %d", $solution_row->id); - /*$query = db_select('lab_migration_solution_files'); - $query->fields('lab_migration_solution_files'); - $query->condition('solution_id', $solution_row->id); - $solution_files_q = $query->execute();*/ - $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.id = :solution_id", array(':solution_id' => $solution_row->id)); - //$solution_dependency_files_q = db_query("SELECT * FROM {lab_migration_solution_dependency} WHERE solution_id = %d", $solution_row->id); - $query = db_select('lab_migration_solution_dependency'); - $query->fields('lab_migration_solution_dependency'); - $query->condition('solution_id', $solution_row->id); - $solution_dependency_files_q = $query->execute(); + $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.solution_id = :solution_id", array(':solution_id' => $solution_row->id)); while ($solution_files_row = $solution_files_q->fetchObject()) { //var_dump($solution_files_row);die; $zip->addFile($root_path . $solution_files_row->directory_name. '/' . $solution_files_row->filepath, $APPROVE_PATH . $EXP_PATH . $CODE_PATH . $solution_files_row->filename); } - /* dependency files */ - while ($solution_dependency_files_row = $solution_dependency_files_q->fetchObject()) - { - //$dependency_file_data = (db_query("SELECT * FROM {lab_migration_dependency_files} WHERE id = %d LIMIT 1", $solution_dependency_files_row->dependency_id))->fetchObject(); - $query = db_select('lab_migration_dependency_files'); - $query->fields('lab_migration_dependency_files'); - $query->condition('id', $solution_dependency_files_row->dependency_id); - $query->range(0, 1); - $dependency_file_data = $query->execute()->fetchObject(); - if ($dependency_file_data) - $zip->addFile($root_path . $dependency_file_data->filepath, $APPROVE_PATH . $EXP_PATH . $CODE_PATH . 'DEPENDENCIES/' . $dependency_file_data->filename); - } } /* unapproved solutions */ - //$solution_q = db_query("SELECT * FROM {lab_migration_solution} WHERE experiment_id = %d AND approval_status = 0", $experiment_row->id); $query = db_select('lab_migration_solution'); $query->fields('lab_migration_solution'); $query->condition('experiment_id', $experiment_row->id); @@ -194,36 +116,14 @@ function lab_migration_download_full_lab() while ($solution_row = $solution_q->fetchObject()) { $CODE_PATH = 'CODE' . $solution_row->code_number . '/'; - //$solution_files_q = db_query("SELECT * FROM {lab_migration_solution_files} WHERE solution_id = %d", $solution_row->id); - /* $query = db_select('lab_migration_solution_files'); - $query->fields('lab_migration_solution_files'); - $query->condition('solution_id', $solution_row->id); - $solution_files_q = $query->execute();*/ $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.id = :solution_id", array(':solution_id' => $solution_row->id)); - - //$solution_dependency_files_q = db_query("SELECT * FROM {lab_migration_solution_dependency} WHERE solution_id = %d", $solution_row->id); - $query = db_select('lab_migration_solution_dependency'); - $query->fields('lab_migration_solution_dependency'); - $query->condition('solution_id', $solution_row->id); - $solution_dependency_files_q = $query->execute(); while ($solution_files_row = $solution_files_q->fetchObject()) { $zip->addFile($root_path .$solution_files_row->directory_name . '/' . $solution_files_row->filepath, $LAB_PATH . $PENDING_PATH . $EXP_PATH . $CODE_PATH . $solution_files_row->filename); } - /* dependency files */ - while ($solution_dependency_files_row = $solution_dependency_files_q->fetchObject()) - { - //$dependency_file_data = (db_query("SELECT * FROM {lab_migration_dependency_files} WHERE id = %d LIMIT 1", $solution_dependency_files_row->dependency_id))->fetchObject(); - $query = db_select('lab_migration_dependency_files'); - $query->fields('lab_migration_dependency_files'); - $query->condition('id', $solution_dependency_files_row->dependency_id); - $query->range(0, 1); - $dependency_file_data = $query->execute()->fetchObject(); - if ($dependency_file_data) - $zip->addFile($root_path . $dependency_file_data->filepath, $LAB_PATH . $PENDING_PATH . $EXP_PATH . $CODE_PATH . 'DEPENDENCIES/' . $dependency_file_data->filename); - } } - } + } + $zip_file_count = $zip->numFiles; $zip->close(); if ($zip_file_count > 0) @@ -242,4 +142,4 @@ function lab_migration_download_full_lab() drupal_set_message("There are no solutions in this lab to download", 'error'); drupal_goto('lab-migration/code-approval/bulk'); } - } +} \ No newline at end of file -- cgit From 6385da42e8310ebc5b3fe0b44fecf31c344e676d Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Mon, 23 Sep 2019 19:22:30 +0530 Subject: Modiy database queries to download files --- full_download.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/full_download.inc b/full_download.inc index bda993d..e108d60 100755 --- a/full_download.inc +++ b/full_download.inc @@ -116,7 +116,7 @@ function lab_migration_download_full_lab() while ($solution_row = $solution_q->fetchObject()) { $CODE_PATH = 'CODE' . $solution_row->code_number . '/'; - $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.id = :solution_id", array(':solution_id' => $solution_row->id)); + $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.solution_id = :solution_id", array(':solution_id' => $solution_row->id)); while ($solution_files_row = $solution_files_q->fetchObject()) { $zip->addFile($root_path .$solution_files_row->directory_name . '/' . $solution_files_row->filepath, $LAB_PATH . $PENDING_PATH . $EXP_PATH . $CODE_PATH . $solution_files_row->filename); -- cgit From 838b20ed0b684555e45c83ef9f8c3f912951a13c Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Tue, 24 Sep 2019 11:46:03 +0530 Subject: Print the list of the solution ids --- full_download.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/full_download.inc b/full_download.inc index e108d60..e48f9fc 100755 --- a/full_download.inc +++ b/full_download.inc @@ -115,15 +115,16 @@ function lab_migration_download_full_lab() $solution_q = $query->execute(); while ($solution_row = $solution_q->fetchObject()) { + var_dump($solution_row->id); $CODE_PATH = 'CODE' . $solution_row->code_number . '/'; - $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.solution_id = :solution_id", array(':solution_id' => $solution_row->id)); + $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.soultion_id = :solution_id", array(':solution_id' => $solution_row->id)); while ($solution_files_row = $solution_files_q->fetchObject()) { $zip->addFile($root_path .$solution_files_row->directory_name . '/' . $solution_files_row->filepath, $LAB_PATH . $PENDING_PATH . $EXP_PATH . $CODE_PATH . $solution_files_row->filename); } } } - + die; $zip_file_count = $zip->numFiles; $zip->close(); if ($zip_file_count > 0) -- cgit From 1b09c2ad2fde4dc4cf62d7d12fa1ca431b9cf41d Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Tue, 24 Sep 2019 11:51:51 +0530 Subject: Comment code printing the solution ids --- full_download.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/full_download.inc b/full_download.inc index e48f9fc..ccbedc2 100755 --- a/full_download.inc +++ b/full_download.inc @@ -115,7 +115,7 @@ function lab_migration_download_full_lab() $solution_q = $query->execute(); while ($solution_row = $solution_q->fetchObject()) { - var_dump($solution_row->id); + //var_dump($solution_row->id); $CODE_PATH = 'CODE' . $solution_row->code_number . '/'; $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.soultion_id = :solution_id", array(':solution_id' => $solution_row->id)); while ($solution_files_row = $solution_files_q->fetchObject()) @@ -124,7 +124,7 @@ function lab_migration_download_full_lab() } } } - die; + //die; $zip_file_count = $zip->numFiles; $zip->close(); if ($zip_file_count > 0) -- cgit From 94abd3880fcf0322b0aa81eecd3c948890d780d5 Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Tue, 24 Sep 2019 11:55:15 +0530 Subject: Modify query to display the soultion files --- full_download.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/full_download.inc b/full_download.inc index ccbedc2..79c4983 100755 --- a/full_download.inc +++ b/full_download.inc @@ -27,7 +27,7 @@ function lab_migration_download_full_experiment() while ($solution_row = $solution_q->fetchObject()) { $CODE_PATH = 'CODE' . $solution_row->code_number . '/'; - $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.id = :solution_id", array(':solution_id' => $solution_row->id)); + $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.soultion_id = :solution_id", array(':solution_id' => $solution_row->id)); while ($solution_files_row = $solution_files_q->fetchObject()) { $zip->addFile($root_path . $solution_files_row->directory_name. '/' . $solution_files_row->filepath, $APPROVE_PATH . $EXP_PATH . $CODE_PATH . $solution_files_row->filename); @@ -100,7 +100,7 @@ function lab_migration_download_full_lab() while ($solution_row = $solution_q->fetchObject()) { $CODE_PATH = 'CODE' . $solution_row->code_number . '/'; - $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.solution_id = :solution_id", array(':solution_id' => $solution_row->id)); + $solution_files_q = db_query("SELECT lmsf.*, lmp.directory_name FROM lab_migration_solution_files lmsf JOIN lab_migration_solution lms JOIN lab_migration_experiment lme JOIN lab_migration_proposal lmp WHERE lms.id = lmsf.solution_id AND lme.id = lms.experiment_id AND lmp.id = lme.proposal_id AND lmsf.soultion_id = :solution_id", array(':solution_id' => $solution_row->id)); while ($solution_files_row = $solution_files_q->fetchObject()) { //var_dump($solution_files_row);die; -- cgit From a8bff8037b6198e0fa788bd733f17f5eec033d9a Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Tue, 24 Sep 2019 12:15:40 +0530 Subject: Minor code changes --- full_download.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/full_download.inc b/full_download.inc index 79c4983..e65c702 100755 --- a/full_download.inc +++ b/full_download.inc @@ -84,7 +84,7 @@ function lab_migration_download_full_lab() /* creating zip archive on the server */ $zip = new ZipArchive; $zip->open($zip_filename, ZipArchive::CREATE); - /* approved solutions */ + $query = db_select('lab_migration_experiment'); $query->fields('lab_migration_experiment'); $query->condition('proposal_id', $lab_id); @@ -97,6 +97,7 @@ function lab_migration_download_full_lab() $query->condition('experiment_id', $experiment_row->id); $query->condition('approval_status', 1); $solution_q = $query->execute(); + /* approved solutions */ while ($solution_row = $solution_q->fetchObject()) { $CODE_PATH = 'CODE' . $solution_row->code_number . '/'; -- cgit