Code Monkey home page Code Monkey logo

joomla-json-db-check's People

Contributors

rn84 avatar robwent avatar zero-24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

joomla-json-db-check's Issues

Joomla complains, the db checker complains, JSON checker says it's valid

Hi,

I have (just found) this problem on my website horsemanshipmagazine.co.uk.
The checker finds hundreds of JSON failures, all in #__content, column attribs (example of the first one below), all syntax errors, and the website is severely broken when a user logs in and accesses anything other than the home page (I think), however the JSON checker (at http://jsonlint.com/) says there's no problem with this one, or any of the others I've tried.

Any idea what's going on?

{"show_title":"","link_titles":"","show_intro":"","show_section":0,"link_section":"","show_category":0,"link_category":"","show_vote":"","show_author":0,"show_create_date":0,"show_modify_date":"","show_pdf_icon":"","show_print_icon":"","show_ email_icon":"","language":"","keyref":"","readmore":"","show_parent_category":"","link_parent_category":"","link_author":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_images_frontend":""}

Invalid JSON not detected

While manually correcting the rows that the script stated, I noticed some more invalid rows that were not detected.

For example if the params column of the users table states

{""activate"":0

this is not detected (however this got into the database).

Still getting JSON error after all fixes

From the article https://www.joomlashack.com/blog/tutorials/error-decoding-json-data-syntax/ I found this script.

However, after running the script and fixing all errors, site still gives JSON error. I modified the Json.php library per https://forum.joomla.org/viewtopic.php?t=937036 and found that there are still param fields in error. Specifically (with that library mod) I get the error " Error decoding JSON data: Syntax error the bad data is: {""}"

I'm not knowledgeable enough to know what module, etc. is generating this.

I thought I'd let you know, at least, that the script is apparently not finding this "error". Running Joomla 3.7.0

"Failed to start application" on Joomla 4

When trying to use the script after upgrade from Joomla 3.10 to 4.40, it failed with

Exception: Failed to start application

Error occured in line 64:

$app = JFactory::getApplication('site');

The exception has been thrown here:

<joomla_dir>/libraries/src/Factory.php:158

     * @throws  \Exception
     */
    public static function getApplication()
    {
        if (!self::$application) {
            throw new \Exception('Failed to start application', 500);
        }
        return self::$application;
    }

Can it be that the way of starting scripts in Joomla has changed somewhere between the versions?

I was able to fix the issue by applying the approach taken here, also considering this post.

After replacing the lines 63-64 with following code, script worked as expected:

    // Instantiate the application.
    $container = \Joomla\CMS\Factory::getContainer();

    $container->alias('session.web', 'session.web.site')
	->alias('session', 'session.web.site')
	->alias('JSession', 'session.web.site')
	->alias(\Joomla\CMS\Session\Session::class, 'session.web.site')
	->alias(\Joomla\Session\Session::class, 'session.web.site')
	->alias(\Joomla\Session\SessionInterface::class, 'session.web.site');

	$app    = $container->get(\Joomla\CMS\Application\SiteApplication::class);

This is of course a "workaround" only, I am not a developer and am not sure about the appropriateness of the code, except that it worked ;).

Can this be addressed / incorporated into some fix?

The script solved my problem by the way, thank you very much! :)

metadata field in K2 can have issues

Not something that's been reported with the core content table so probably not something to check globally as it could timeout on large sites.

did not fix anything

I have tried running it on my site, with gantry, fluent theme from rockettheme and I still get the error message.

"Error decoding JSON data: Syntax error"

any one got a new version?

Poul

JSON

If it helps anyone, I was able to correct the 3.6.4 JSON upgrade error by using json-db-check.php:

It found and corrected all of my errors except for one. The error can manually be repaired by going into the database "extensions" table and "com_languages" column

I changed this:

{
"administrator":""en-GB"","site":""en-GB""
}

to this:

{
"administrator": ""en-GB"",
"site": ""en-GB""
}

Everything works again. json-db-check.php is genius and thank you @robwent or taking the time to share it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.