Skip to content

Exception in 'apiDocumentationEditorIsEnabled' in sidebar.js #826

@brylie

Description

@brylie

In the master layout, sidebar.js contains a logical error that causes an exception when settings are not present. Specifically, the funciton tries to return settings.apiDocumentationEditor.enabled when settings may not be available. Change the function to resemble the following:

apiDocumentationEditorIsEnabled : function() {
    // Saving the fields apiDocumentationEditor.enabled into the variable
    // settings.
    var settings = Settings.findOne({},{"apiDocumentationEditor.enabled": 1, _id:0})
    // Accessing the value of enabled in the apiDocumentationEditor Object
    if(settings && settings.apiDocumentationEditor) {
      return settings.apiDocumentationEditor.enabled
    }
  }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions