Picture of Marissa Preciado
How to troubleshoot properties.schema
by Marissa Preciado - Friday, 8 March 2019, 6:37 PM
 

I made a few edits to the adapt-contrib-drawerPageNavigation extension to disable some contentObjects from showing in the Navigation. I have the edits working in the framework and uploading to the AT goes without a hitch. But when I go to edit a page, nothing will load on the page. Nothing shows up in the logs but in the console, I see "Uncaught TypeError: Cannot read property 'unselectable' of null" and "Uncaught TypeError: (0 , this.schema.type) is not a constructor".

I'm fairly certain this is an issue with the properties.schema file but I don't know of a way to troubleshoot what it is. 

For reference, my properties.schema file is below:

{
"type":"object",
"$schema": "http://json-schema.org/draft-04/schema",
"id": "http://jsonschema.net",
"required":false,
"properties":{
"pluginLocations": {
"type":"object",
"required":true,
"properties":{
"config": {
"type":"object"
},
"course": {
"type":"object",
"properties": {
"_drawerPageNavigation": {
"type": "object",
"required": false,
"legend": "Navigation",
"properties": {
"_isEnabled": {
"type": "boolean",
"required":true,
"default": true,
"title": "Is enabled",
"inputType": {"type": "Boolean", "options": [true, false]},
"validators": [],
"help": "If set to 'false', Resources will be disabled"
},
"title": {
"type": "string",
"default":"Navigation",
"required": true,
"title": "",
"inputType": "Text",
"validators": ["required"],
"translatable": true
},
"description": {
"type": "string",
"default":"Click here to navigate this course",
"required": false,
"title": "",
"inputType": "Text",
"validators": [],
"translatable": true
}
}
}
}
},
"contentobject": {
"type": "object",
"properties": {
"_drawerPageNavigation": {
"type":"boolean",
"required": false,
"legend": "Show in Drawer TOC",
"properties":{
"_showInDrawerTOC": {
"type": "boolean",
"required": true,
"default": true,
"title": "Enable show in TOC",
"inputType": "Checkbox",
"validators": [],
"help": "Enables/disables visibility in the drawer TOC"
}
}
}
}
},
"article": {
"type":"object"
},
"block": {
"type":"object"
},
"component": {
"type":"object"
}
}
}
}
}

 

Any suggestions?

Picture of Matt Leathes
Re: How to troubleshoot properties.schema
by Matt Leathes - Saturday, 9 March 2019, 4:52 PM
 

You're correct. And, unfortunately, troubleshooting these (beyond checking that the JSON is valid) is not easy.

This is your problem:

That should be "type": "object"

(if you want to know how I figured this out, I compared your file to the original so that I could see what you had changed - to give me an idea of where any potential problems might lie - then compared that the same section of one I know works OK to see where there were obvious differences)

Picture of Marissa Preciado
Re: How to troubleshoot properties.schema
by Marissa Preciado - Monday, 11 March 2019, 4:12 PM
 

That worked! Thank you! I did try comparing it to the original however since that was a new section, I didn't have much to compare it to other than other component's properties.schema. I imagine I'll be able to troubleshoot these alot better after I've had a bit more experience with them.

 

Thank you!