mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Improve data errors for twig
This commit is contained in:
parent
b707671cd8
commit
620bd18cf9
@ -298,6 +298,9 @@ class PreviewController extends BaseController
|
||||
->mock();
|
||||
} catch(SyntaxError $e) {
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
return response()->json(['message' => 'invalid data access', 'errors' => ['design.design.body' => $e->getMessage()]], 422);
|
||||
}
|
||||
|
||||
if (request()->query('html') == 'true') {
|
||||
return $ts->getHtml();
|
||||
|
@ -31,12 +31,8 @@ class TwigLint implements ValidationRule
|
||||
try {
|
||||
$twig->parse($twig->tokenize(new \Twig\Source(preg_replace('/<!--.*?-->/s', '', $value), '')));
|
||||
} catch (\Twig\Error\SyntaxError $e) {
|
||||
// echo json_encode(['status' => 'error', 'message' => $e->getMessage()]);
|
||||
nlog($e->getMessage());
|
||||
$fail($e->getMessage());
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -482,6 +482,8 @@ class TemplateService
|
||||
default => $processed = [],
|
||||
};
|
||||
|
||||
nlog(json_encode($processed));
|
||||
|
||||
return $processed;
|
||||
|
||||
})->toArray();
|
||||
|
Loading…
x
Reference in New Issue
Block a user