I was using the Control Panel JS plugin, and I entered some erroneous JavaScript that caused it to break the control panel. I then deleted its row in the plug-ins table in the database, and all associated files.

However, when I reinstall it, it finds the old JavaScript and things break again. I cannot figure out where this information is stored.

  • If you deleted the external JS file, then it shouldn’t be able to trigger anything, correct? Or did you enter the JS directly into the control panel? – Lindsey D May 15 '20 at 18:48

Assuming that you entered your explosive JavaScript directly into the control panel (as opposed to an external file), the answer is... complicated.*

* Disclaimer: I am not a Project Config expert. This advice has not been thoroughly tested. Please tread carefully when editing your database and/or project.yaml file.

If you're using Project Config, you'll want to update the value stored in your config/project.yaml file. Once you've done that, run ./craft project-config/sync to update your database accordingly.

If you're not using Project Config, then you should be able to just update the database directly. Go to the projectconfig table and change this row...

|  plugins.cp-js.settings.additionalJs  |  (your explosive js)  |

For reference, here's a flowchart to illustrate how the data gets saved...

Plugin Settings Flowchart

  • 1
    Yes, I had enter my JS directly into the control panel. Brilliant! Your answer solves it. Thanks. – 4midori May 16 '20 at 1:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.