Fatal error: Call to a member function get() on a non-object in ../core/model/modx/modtemplatevar.class.php on line 296
$context = !empty($resourceId) ? $this->xpdo->getObject('modResource', $resourceId)->get('context_key') : $this->xpdo->context->get('key');This question has been answered by BobRay. See the first response.
if (!empty($resourceId)) {
$this->xpdo->getObject('modResource', $resourceId);
$context = $resource->get('context_key');
} else {
$context = $this->xpdo->context->get('key');
}Fatal error: Call to a member function get() on a non-object in ../core/model/modx/modtemplatevar.class.php on line 298
$context = $resource->get('context_key');if (!empty($resourceId)) {
$resource = $this->xpdo->getObject('modResource', $resourceId);
if (!$resource) {
$modx->log(modX::LOG_LEVEL_ERROR, '[modTemplateVar] Resource not found: ' . $resourceId);
$context = $this->xpdo->context->get('key');
} else {
$context = $resource->get('context_key');
}
} else {
$context = $this->xpdo->context->get('key');
}$modx->log(modX::LOG_LEVEL_ERROR, '[modTemplateVar] Resource not found: ' . $resourceId);