I'm having problems restoring any course that uses the eMail List block. The error messages are:
o Creating blocks
o Notice: Undefined variable: subfolders in /var/www/html/ourserver/blocks/email_list/email/restorelib.php on line 241
o Warning: Invalid argument supplied for foreach() in /var/www/html/ourserver/blocks/email_list/email/restorelib.php on line 263
o Error while creating the course blocks
Here's the referenced code:
240 //restore the subfolders
241 $status = email_subfolders_restore($subfolders, $restore);
242
243 return $status;
244 }
245
246 /**
247 * This function restores the email_subfolder.
248 *
249 * @uses $CFG
250 * @param int $folder Folder ID
251 * @param $info
252 * @param $restore
253 * @return boolean Success/Fail
254 */
255 function email_subfolders_restore($subfolders, $restore) {
256
257 global $CFG;
258
259 $status = true;
260
261 //restore the actual subfolders now
262
263 foreach($subfolders as $subfolder) {
264 if ($newchildid = backup_getid($restore->backup_unique_code, 'block_email_list_folder', $subfolder->oldfolderchildid)) {
265 //found the new id
266 $subfolder->folderchildid = $newchildid->new_id;
267 } else {
268 $status = false;
269 break;
270 }
271 //insert the new record
272 if (!$newsubid = insert_record('block_email_list_subfolder', $subfolder)) {
273 $status = false;
274 break;
275 }
276 }
277
278 return $status;
279 }
In reply to Blair F.
This forum post has been removed
The content of this forum post has been removed and can no longer be accessed.