Topic: Unknown JSON error [SOLVED]

Greetings,

I find myself unable to save changes to my Showkase (v1.7.5) pages at studiosaid.com

When I attempt to move a page "Gallery" to Hidden pages... and when I attempt to rename a page "Musalla al-Marwani-03" that I just imported from JuiceboxBuilder-Pro (v1.5.1)... then upon clicking Save, I receive the error message "Unknown JSON error" and the changes do not stick.

I can Publish (sadly, because the undesired versions are now public) but even after Logging Out and back In, I cannot make the desired changes.

Suggestions Please?

Thank you,
-Saïd

[Working in Firefox v82.0.2 on OS 10.13.6]

Re: Unknown JSON error [SOLVED]

I'm sorry to hear that you are having difficulties with Showkase.

Unfortunately, this is not an error that I've encountered before (wither personally or via a user report) so, at the moment, I do not know what might be causing it.

Has anything changed on your web server (e.g. PHP version) recently which might somehow be contributing to your problem?

What version of PHP does your web server use? Do you have the option of updating it? If so, it might be worth trying. (The current stable version is PHP 7.4.12.)

Before trying anything, please make a full backup of your current site, just in case anything further goes wrong and you need to reinstate your files at a later date.

It sounds like the error is a server error (rather than specifically a Showkase error) but I'd try running Showkase in debug mode in case any more descriptive error messages are displayed in the Showkase status bar before the JSON error occurs.
Open your 'showkase/admin/settings/constants.php' file in a plain text editor and change line 12 from:

define('DEBUG', false);

... to:

define('DEBUG', true);

Please note that the line number above refers to the current version of Showkase (v1.7.5).

If you have recently upgraded to Showkase v1.7.5, then I'd also try going through the upgrade process again (with the same v1.7.5 files) to ensure that all Showkase core files are present and correct on your web server (in case anything went wrong during the initial upgrade process resulting in corrupt or missing files).

One more thing I'd try is to go to 'System -> Repairs -> Repair' (in Showkase's interface) to rebuilt the page records.

If none of the suggestions above work, then the best course of action would be to determine the exact nature of the problem.
If you can access your web server error logs, then there should be an entry corresponding to the JSON error which might hopefully let us know exactly what Showkase file (and what line of code within the file) is causing the error.
Please let me know what your error log records for the problem.

I hope these notes help.
Please let me know how you get on and if I can be of any further assistance.
I'd be happy to help further might it would be helpful if I had access to your web server and Showkase site so that I can reproduce the error for myself and investigate further.
If you continue to experience difficulties and are agreeable to allowing me access, then please email me (my email address is below my username to the left of this post) with your FTP and Showkase login details. (I believe that I have previously logged into your web site a while ago.)
Thank you.

Re: Unknown JSON error [SOLVED]

Thanks Stephen,

Am working my way down your list, however downloading website is 6-8 hours!

Is your email address at showkase dot-net or dot-com?

Much obliged

Re: Unknown JSON error [SOLVED]

Php version is Php 5.3.19

Am told they will be upgrading this weekend :-)

Re: Unknown JSON error [SOLVED]

Thanks Stephen,

You're welcome!

Am working my way down your list, however downloading website is 6-8 hours!

A full backup shouldn't really be necessary but better to be safe than sorry!

Is your email address at showkase dot-net or dot-com?

steven at simpleviewer dot net (or steven at juicebox dot net)

Php version is Php 5.3.19

Thank you for the information. PHP 5.3.19 should be fine. (Showkase requires PHP 5.2.0 or later.)
I'm really not sure why the problem has not occurred until now. If the problem started recently, then it is certainly possible that something might have changed on your web server to cause the problem.
In any case, when I get your email, I'll investigate further.
Thank you.

Re: Unknown JSON error [SOLVED]

Delving into the Showkase source code, it looks like the problem is that NULL is being returned when the JSON string used for the tree on the 'Pages' tab is run through the PHP json_decode function.
What I don't know at this point is why this is happening in your site (i.e. why your site's JSON string cannot be decoded). I cannot replicate this problem with my own test sites.
When I'm able to see the actual JSON string that your own site uses, I should hopefully be able to advance the investigation and figure out why it cannot be decoded. Maybe there's a syntax problem with Showkase's formatting of the JSON string or maybe what should be a JSON string is NULL before decoding is attempted or perhaps there's even a bug relating to the json_decode function in PHP 5.3.19 (unlikely, but in the absence of knowing what is causing the problem, I'll not rule anything out quite yet).

Re: Unknown JSON error [SOLVED]

[Conversation continued via email.]

Re: Unknown JSON error [SOLVED]

All I gotta say is that although the Showkase software is really nice... the Support is better than superb.

Steven, you take the cake. Thank you for sleuthing the problem in my site with mismatching Owner/Group settings and for acquainting me with a (free) tool to see this aspect of my directories (FileZilla).

The site is working smoothly now as expected.

Hats Off to You

Re: Unknown JSON error [SOLVED]

You're welcome!

Thank you very much for your kind words and for the update.
I appreciate you taking the time to let me know that your Showkase site is back up and running. I'm very happy to hear that your problem has been resolved.

I hope that everything goes smoothly in the future but, if you encounter any further problems, just post back here in the forum and I'll do my best to help you out.

I'll mark this thread as [SOLVED].

All the best!