Picture of Milton Plotkin
Custom theme - "Error generating preview, please contact Administrator."
by Milton Plotkin - Thursday, 19 January 2017, 12:03 AM
 

Hello,

I have been using Adapt for a bit now, and have successfully created a custom theme using the Adapt Framework. I need this theme to be useable with the Adapt Authoring tool now, as we have a large amount of content to make which will be hindered if we need to type it all in through Json files.

However, after successfully uploading my custom theme, attempting to preview my work causes the following error:

Error generating preview, please contact Administrator.

I have stress tested this by duplicating the Vanilla theme exactly, and copying certain customized files over it, and have determined that the issue lies somewhere in one or more of the .less scripts.

To create my custom theme, I modified close to 20 .less scripts, and running them through http://lesstester.com/ yielded no errors. Is there any way to know what specifically is causing the issue?

Thank you very much in advance.

Picture of Helen Bailey
Re: Custom theme - "Error generating preview, please contact Administrator."
by Helen Bailey - Thursday, 19 January 2017, 9:40 AM
 

Are you running it through node server in your command line? If so what does it say in your command line window when you try and preview?

Picture of Milton Plotkin
Re: Custom theme - "Error generating preview, please contact Administrator."
by Milton Plotkin - Friday, 20 January 2017, 2:00 AM
 

I don't think I am. I'm importing it with the "Import plugin" button in the Adapt Authoring Tool. It imports just fine (gives me a big green tick), but when I click "Preview" in the Authoring Tool for a course that uses the theme, I get the error.

Picture of John Niezen
Re: Custom theme - "Error generating preview, please contact Administrator."
by John Niezen - Friday, 20 January 2017, 6:53 AM
 

Hi Milton,

Did you also pointed to this new theme in your course? What sometimes helps is in the Theme picker, point once to the Vanilla, then to your custom, and hit save. But not 100% waterproof :-(

Picture of Milton Plotkin
Re: Custom theme - "Error generating preview, please contact Administrator."
by Milton Plotkin - Sunday, 22 January 2017, 11:43 PM
 

Yeah, I tried that :(

I've tried brute forcing it. I started with the Vanilla theme, imported it, and it worked! I then changed one colour in the colors.less file, imported it, and it still worked.

Now, I could, in theory do this method for every change I made to my custom theme to weed out the css it has an issue with. However, this process would take a very long time, and I also suspect there are multiple CSS lines it takes issue with. Please note that when I compile my course in the command line, it reports 0 issues and runs just fine, so is there maybe a "strict" compile option in Grunt?

Picture of Christian Lee
Re: Custom theme - "Error generating preview, please contact Administrator."
by Christian Lee - Monday, 23 January 2017, 1:08 PM
 

I've been having the same issue. and after some research altering the bower.json worked! Now the theming fun begins!!

 

open the bower.json and rename and change the version numbers. 

 

I admit I didn't change much just the primary and secondary, but trying this worked

 

Chris

 

Picture of Milton Plotkin
Re: Custom theme - "Error generating preview, please contact Administrator."
by Milton Plotkin - Tuesday, 24 January 2017, 12:21 AM
 

Nah, that's not it. It's good practice to do it, but Adapt won't even let you upload until your version number is different (which just adds another step during the brute force method I used :/ ).

Picture of aaron quinn
Re: Custom theme - "Error generating preview, please contact Administrator."
by aaron quinn - Tuesday, 24 January 2017, 6:19 AM
 

like you, i made a duplicate of the vanilla theme - just so i could mess around with some things. i called it humbug. now that it's installed in the authoring tool, i make changes to the files here, while the course is still loaded in the AT:

 

then i simply go back to the authoring tool, click theme picker, click save (humbug is already selected), click preview. the course loads in a browser and i can see the changes i've made. if things work out, i save the same changes to my local version of the theme:

 

knowing i make mistakes, i got familiar with the theme's other location in the versions directory:

 

because when i break something while making changes, i can either replace the broken file with a fresh copy from my local version, or i can delete both of these theme folders and the entry in the mongodb database using robomongo:

 

if i delete the folders and db entry, i can re-upload a new local version of the theme, which is still numbered 0.0.1, and i won't wind up having a hundred unwanted versions of the theme. this process took me a while to figure out, but now that i've done it a good number of times, it's pretty easy and pretty quick. it can be done like this with plugins, too. maybe it can help shorten the time it takes for you to find the cause of your issue. i'd start with a working base version and replace one file at a time until i find the one that breaks the preview. then fix that file, rinse and repeat.

Picture of Milton Plotkin
Re: Custom theme - "Error generating preview, please contact Administrator."
by Milton Plotkin - Friday, 27 January 2017, 7:07 AM
 

Well, that's certainly better than my current method of doing things. Thank you! I'll debug my theme using it and see how I go. I do hope though that in future we can get more detailed error messages :/