Skip to content

Commit

Permalink
Merge branch '4.0' into 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Jan 26, 2019
2 parents d78d775 + 3edd86b commit c7d3fcb
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/Services/QueuedJobService.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,9 @@ protected function copyDescriptorToJob($jobDescriptor, $job)
$jobData = @unserialize($jobDescriptor->SavedJobData);
$messages = @unserialize($jobDescriptor->SavedJobMessages);

if (!$jobData) {
// SS's convert:: function doesn't do this detection for us!!
if (function_exists('json_decode')) {
$jobData = json_decode($jobDescriptor->SavedJobData);
$messages = json_decode($jobDescriptor->SavedJobMessages);
} else {
$jobData = Convert::json2obj($jobDescriptor->SavedJobData);
$messages = Convert::json2obj($jobDescriptor->SavedJobMessages);
}
}
// try decoding as json if null
$jobData = $jobData ?: json_decode($jobDescriptor->SavedJobData);
$messages = $messages ?: json_decode($jobDescriptor->SavedJobMessages);

$job->setJobData(
$jobDescriptor->TotalSteps,
Expand Down

0 comments on commit c7d3fcb

Please sign in to comment.