Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hey John,

    If the snippet is marked as inactive, then it will save without any of the usual code checks.

    Thread Starter John L.

    (@jpl208202)

    Is there a way to have it check the code in active snippets for error and if error is detected you can hit back button without losing changes? When I first installed it this seemed to be the behavior. Now it reverts the changes to the saved version. It would be helpful if we can go back and correct the error instead of redoing all the changes.

    Plugin Author Shea Bunge

    (@bungeshea)

    Ah, I think I see what you’re saying. The way that things are currently set up now is that the code isn’t checked per-se, instead it’s executed before being saved to the database, so that if it produces an error and crashes the site, then the faulty code will never be saved.

    I haven’t made any change to the behaviour you describe, where pressing the back button returns you to the version of the snippet you were last editing. This functionality wasn’t really controlled by the plugin, but was something that was more a function of whatever browser is being used. In fact, that’s the way that it still works for me.

    I suppose that if you did want the code to save no matter what, I could change the behaviour so instead of leaving the site untouched when a snippet produces an error, the code is first saved to the database and the snippet deactivated, then the code is run, then if there were no issues the snippet is reactivated. The problem I see with this is that if the snippet was a pretty essential one for the site, then deactivating in case of an error might not be nearly as good as simply leaving the previous version as-is.

    Thread Starter John L.

    (@jpl208202)

    I agree it is best not to save an error in the snippet. I must have been using a different browser when I was able to hit the back button without losing changes. I’ll have to find out what browser setup I was using because it was very convenient; not losing changes but also not breaking the site is the best scenario.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Save despite syntax error’ is closed to new replies.