Skip to content

Commit

Permalink
Skip vehicles with invalid classes
Browse files Browse the repository at this point in the history
This should address problems experienced when new classes are added in new versions of MODX Revolution and the teleport tpls, but teleport is run against older versions of MODX Revolution

See issue #21
  • Loading branch information
opengeek committed Jul 17, 2015
1 parent f47dc58 commit b2a43be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Teleport/Action/Extract.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ protected function createVehicles($vehicle)
case '\\Teleport\\Transport\\xPDOObjectVehicle':
case 'xPDOObjectVehicle':
$realClass = $this->modx->loadClass($vehicle['object']['class']);
if ($realClass === false) {
$this->request->log("Invalid class {$vehicle['object']['class']} specified; skipping vehicle");
break;
}
$graph = isset($vehicle['object']['graph']) && is_array($vehicle['object']['graph'])
? $vehicle['object']['graph'] : array();
$graphCriteria = isset($vehicle['object']['graphCriteria']) && is_array($vehicle['object']['graphCriteria'])
Expand Down

0 comments on commit b2a43be

Please sign in to comment.