Thread:Project:Support desk/ JobQueue Issue with inserting a new Job

Hi fellows,

I've been working on an extension that's using the JobQueue to make new pages. Since using the JobQueue is no rocket science I managed to set it up properly.

Although there is of course; one struggle. It seems the Job is only inserted when an exception (missing function - no use anymore) has been thrown. Of course; I removed the deprecated function to remove the exception. Fortunately after I fix the exception the job won't be inserted into the database.

Code to insert the job:

function insertJob($xmlstring) {

global $wgOut, $wgBizzdesignerImportElementsToProcess, $wgBizzdesignerImportRelationsToProcess, $wgBizzdesignerImportRemoveFromPageTitles, $wgBizzdesignerImportMaxTitleLenght, $wgTmpDirectory; // Create random file

$randFile = uniqid. '.xml'; // Save file to tmp dir

file_put_contents($wgTmpDirectory . '/' . $randFile, $xmlstring);

$params = array(

'file' => $wgTmpDirectory. '/' . $randFile,

'debug' => false

);	$title = Title::newMainPage;

$job = new BizzdesignerNewImport($title, $params);

Job::batchInsert(array($job));

return true;

}

As you can see, this function doesn't use rocket science, and nothing is wrong.

Do you have any suggestions how to fix this? Thanks in advance