Last active
November 7, 2016 16:43
-
-
Save PhilETaylor/8737e58ebba822ca72fe053e2b4f1047 to your computer and use it in GitHub Desktop.
Fix for corrupt JSON strings in Joomla database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Phil Taylor <phil@phil-taylor.com> | |
-- @see https://github.com/joomla/joomla-cms/issues/12460 | |
-- replace jos_ with your database prefix (left as jos and not #__ for syntax highlighting) | |
-- This is not a COMPLETE fix, this only fixes SOME of the core columns in tables that contain JSON. | |
-- BACKUP YOUR DATABASE BEFORE RUNNING THIS!!!!!! | |
UPDATE jos_modules SET params = "{}" WHERE params = "" OR params = '{\"\"}' OR params = '{\\\"\\\"}'; | |
UPDATE jos_menu SET params = "{}" WHERE params = "" OR params = '{\"\"}' OR params = '{\\\"\\\"}'; | |
UPDATE jos_extensions SET params = "{}" WHERE params = "" OR params = '{\"\"}' OR params = '{\\\"\\\"}'; | |
UPDATE jos_assets SET rules = "{}" WHERE rules = "" OR rules = '{\"\"}' OR rules = '{\\\"\\\"}'; | |
-- Run the above SQL FIRST and see if that fixes your site - if not continue and run these additional sql queries, you may not need these! | |
-- DO NOT run this if you are using Widgetkit because they stupidly have json, within json... | |
UPDATE jos_modules SET params = REPLACE(params, '\\"', '"'); | |
UPDATE jos_menu SET params = REPLACE(params, '\\"', '"'); | |
UPDATE jos_extensions SET params = REPLACE(params, '\\"', '"'); | |
UPDATE jos_assets SET rules = REPLACE(rules, '\\"', '"'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment