Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: m4z on April 10, 2019, 06:56:25 PM

Title: Sources/Load.php (Line 1592): Json decode error: Syntax error, malformed JSON
Post by: m4z on April 10, 2019, 06:56:25 PM
I'm seeing an issue similar to this 2017 thread about upgrade problems: index.php?topic=555369.msg3936643#msg3936643 ("Sorry, you are not allowed to post external links."). However, in my case I'm in a fresh SMF2.1rc2 install.

Full error log entry:

The error appears often, probably for every request.

I have used the SMF_UTF8_Diag.php script from the above thread and will try to attach the (redacted, no special characters removed) output.
Title: Re: Sources/Load.php (Line 1592): Json decode error: Syntax error, malformed JSON
Post by: m4z on April 11, 2019, 04:36:12 AM
I forgot to mention the env details:
Title: Re: Sources/Load.php (Line 1592): Json decode error: Syntax error, malformed JSON
Post by: albertlast on April 11, 2019, 10:15:52 AM
Ther is an error in the pg setup,
this get fixed by this pr: https://github.com/SimpleMachines/SMF2.1/pull/5593/files

You can choose to reinstall your version fix this fix or
to generated a new version of displayfields.

To generate the value new you can add a new custom fields under "Custom Profile Fields" and than remove it again.

This could also fix you other issue here: https://www.simplemachines.org/community/index.php?topic=567071.0
Title: Re: Sources/Load.php (Line 1592): Json decode error: Syntax error, malformed JSON
Post by: m4z on April 11, 2019, 02:31:24 PM
Quote from: albertlast on April 11, 2019, 10:15:52 AM
Ther is an error in the pg setup,
this get fixed by this pr: https://github.com/SimpleMachines/SMF2.1/pull/5593/files

You can choose to reinstall your version fix this fix or
to generated a new version of displayfields.

To generate the value new you can add a new custom fields under "Custom Profile Fields" and than remove it again.

Thanks, can you elaborate on the second case? I'd prefer not reinstalling (because I don't know yet how to save and restore the DB in that case). Where do I find these "Custom Profile Fields"? Are you refering to the SMF Mod of the same name (https://custom.simplemachines.org/mods/index.php?mod=319)? Can I add _any_ new custom field or does it have to have certain options?
Title: Re: Sources/Load.php (Line 1592): Json decode error: Syntax error, malformed JSON
Post by: m4z on April 11, 2019, 02:37:38 PM
Hmm, the mod isn't compatible with 2.1rc2 and gave an unspecified error during the first step of install, so I didn't proceed installing it.
Title: Re: Sources/Load.php (Line 1592): Json decode error: Syntax error, malformed JSON
Post by: Arantor on April 11, 2019, 02:45:25 PM
No, the mod was later built into SMF.

You need to go to admin, use the built in feature to add any new field, doesn't matter what, and remove it again.
Title: Re: Sources/Load.php (Line 1592): Json decode error: Syntax error, malformed JSON
Post by: m4z on April 11, 2019, 02:47:10 PM
After reading the SMF2.0 features and options docs (https://wiki.simplemachines.org/smf/SMF2.0:Features_and_Options#Profile_Fields) and "How to use Advanced Profile Fields" in the wiki (https://wiki.simplemachines.org/smf/How_to_use_Advanced_Profile_Fields), I think you're referring to Administration Center -> Configuration -> Features and Options -> Profile Fields.
Title: Re: Sources/Load.php (Line 1592): Json decode error: Syntax error, malformed JSON
Post by: Arantor on April 11, 2019, 02:52:17 PM
Yes, that's what we're referring to.
Title: Re: Sources/Load.php (Line 1592): Json decode error: Syntax error, malformed JSON
Post by: m4z on April 11, 2019, 03:05:12 PM
Thanks, that fixed my problem mentioned above! (The offset errors from my other thread remain, though.)