mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
🐛 Fixed error message when get helper doesn't have API access (#10892)
closes #10875
This commit is contained in:
parent
e497486e78
commit
b431dc56cb
2 changed files with 3 additions and 8 deletions
|
@ -40,14 +40,10 @@ labs.enabledHelper = function enabledHelper(options, callback) {
|
|||
|
||||
common.logging.error(new common.errors.DisabledFeatureError(errDetails));
|
||||
|
||||
errString = new SafeString(
|
||||
'<script>console.error("' + _.values(errDetails).join(' ') + '");</script>'
|
||||
);
|
||||
errString = new SafeString(`<script>console.error("${_.values(errDetails).join(' ')}");</script>`);
|
||||
|
||||
if (options.async) {
|
||||
return Promise.resolve(function asyncError() {
|
||||
return errString;
|
||||
});
|
||||
return Promise.resolve(errString);
|
||||
}
|
||||
|
||||
return errString;
|
||||
|
|
|
@ -42,8 +42,7 @@ describe('{{#get}} helper', function () {
|
|||
inverse.called.should.be.false();
|
||||
|
||||
should.exist(result);
|
||||
result.should.be.a.Function();
|
||||
result().should.be.an.Object().with.property(
|
||||
result.should.be.an.Object().with.property(
|
||||
'string',
|
||||
'<script>console.error("The {{#get}} helper requires your theme to have API access. ' +
|
||||
'Please enable the v2 API via your theme\'s package.json file. ' +
|
||||
|
|
Loading…
Add table
Reference in a new issue