Custom Fields Disappeared! Please Help

Hi guys, I have emailed support a number of times but not had a response on this.

I’m not sure how but our S2 member custom field options on our membership site have somehow dissapeared.

When I got to re-enable them in S2 member they are not there as you can see in the screenshot below:

We have had our developers look into this issue and what they have found it the below:

In “Custom Registration/Profile Fields” tab there is section called: Custom Registration/Profile Fields:
In page source you will see input type hidden

<input type=“hidden” name="ws_plugin__s2member_custom_reg_fields…
which have all data with & which is " in html, not 100% sure is this a generation bug or this is ok.
https://www.monosnap.com/file/4rVnPDoOWMvBepJZc18OaehblCe3cf

Looks like this input should generate those data to DIV below:

but it is not. This above multiple " codes could be issue.

We have deactivated all other plugins and someone mentioned it’s a java error and it is something the developer should be able to fix in their code but I’ve had no response for 3 months from support.

The custom fields are there in the source code so they are in the system but they aren’t showing on the page and when users sign up they cannot see them on the forms: https://prnt.sc/kss2x2

Many thanks

Jai

Again, this sounds like you have a conflict with another plugin.

Hi Tim, thanks, we have deactivated all the other plugins except s2member and nothing changes, we don’t have a test site and can’t do a clean install, is there any other way to identify and remove a plugin conflict?

@KTS915

Not really. This is a JavaScript problem and those are notoriously hard to debug if you can’t identify a plugin conflict.

What is the URL of the page where you have the form?

The table is showing in the Source code but it’s being hidden, this is what our developers found.

They also shared with me this txt file: https://cdn.livechat-static.com/api/file/v2/lc/att-old/8801096/f498f202226d47e971a45f5ceffc8a13/Adam%20Wallis.txt

This affects ALL the forms on the site but one of the forms is on this page: http://www.legends.report/monthly-7-habits-mastery-legends-report-registration-payment-4-month-non-members/

Thanks for your help Tim.

@KTS915

Our developers also found the error is linked to a file in the plugin and asked us to check with the developer, what can we do about this?

They said the console error is directly related to that file form the plugin…

“You need to ask the developer to check the console and the source code to see that there’s an issue related to that plugin and also that the fields are loaded but set to hidden”

@KTS915

You have JavaScript errors on that page. See for yourself by right-clicking somewhere, then select Inspect Element, then Console, and then refresh the page.

JavaScript is single-threaded so, if those errors occur before the s2Member JavaScript is due to run, the latter will simply never run. So you need to fix those errors first.

Thanks Tim, that’s helpful but how do I go about fixing those errors? We have a junior developer working with us. @KTS915

I have never seen that type of error before, so have no idea. I suggest a Google.

@jairaj Did you also change the theme to some standart WP theme? JS errors can be generated by theme too.

If you need a developer, feel free to call me.

Thanks @krumch and @KTS915 this is the report from our developer below, can you help at all?

…The issue can be reproduced on the wp-admin page where the database is present. The issue does not occur with the same code but a new database (fresh install of Wordpress).

As I activated the plugins one by one on the fresh install the issue could not be reproduced. With the Avada theme deactivated and a default theme activated the issue did still occur.

I have attempted to locate by a database search the id of the hidden div element. Searching for .hide does not match anything in the database whereas hide alone matches in tables including posts and images.

With the fusion builder disabled with the database the issue still occurs so I would conclude that it isn’t jquery added in Avada shortcodes.

I have attempted a clean reinstall of the S2member by deleting all data according to the plugin docs.

My next idea is to try using Jquery to show the fields which have been hidden as a temporary fix until the cause can be identified. Are there any thoughts you have which I could try?

The errors in the browser are as follows:

jquery.json-ps.min.js?ver=170722-170722-3526532454:1 Uncaught SyntaxError: JSON.__parse
at JSON.__parse (jquery.json-ps.min.js?ver=170722-170722-3526532454:1)
at Object.a.JSON.parse (jquery.json-ps.min.js?ver=170722-170722-3526532454:2)
at admin.php?ws_plugin__s2member_menu_pages_js=1222812248&ver=170722-170722-3526532454:2
at HTMLDocument. (admin.php?ws_plugin__s2member_menu_pages_js=1222812248&ver=170722-170722-3526532454:3)
at i (jquery.js?ver=1.12.4:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
at Function.ready (jquery.js?ver=1.12.4:2)
at HTMLDocument.K (jquery.js?ver=1.12.4:2)
JSON.__parse @ jquery.json-ps.min.js?ver=170722-170722-3526532454:1
a.JSON.parse @ jquery.json-ps.min.js?ver=170722-170722-3526532454:2
(anonymous) @ admin.php?ws_plugin__s2member_menu_pages_js=1222812248&ver=170722-170722-3526532454:2
(anonymous) @ admin.php?ws_plugin__s2member_menu_pages_js=1222812248&ver=170722-170722-3526532454:3
i @ jquery.js?ver=1.12.4:2
fireWith @ jquery.js?ver=1.12.4:2
ready @ jquery.js?ver=1.12.4:2
K @ jquery.js?ver=1.12.4:2

the below error repeats constantly whilst on the page:

wp-auth-check.js?ver=4.9.8:101 Uncaught TypeError: Cannot read property ‘hasClass’ of undefined
at HTMLDocument. (wp-auth-check.js?ver=4.9.8:101)
at HTMLDocument.dispatch (jquery.js?ver=1.12.4:3)
at HTMLDocument.r.handle (jquery.js?ver=1.12.4:3)
at Object.trigger (jquery.js?ver=1.12.4:3)
at Object.jQuery.event.trigger (jquery-migrate.js?ver=1.4.1:633)
at HTMLDocument. (jquery.js?ver=1.12.4:3)
at Function.each (jquery.js?ver=1.12.4:2)
at jQuery.fn.init.each (jquery.js?ver=1.12.4:2)
at jQuery.fn.init.trigger (jquery.js?ver=1.12.4:3)
at Object. (heartbeat.js?ver=4.9.8:404)

The browser on your pictures looks like Firefox? Did you test with other browsers?

Also on the second picture, the file you point at looks like jQuery plugin, used with s2M, not “native” s2M file. Try to refresh the s2M’s files (just delete existing installation and copy it by FTP from a fresh downloaded copy), they may be corrupted.

Thanks @krumch our dev has tried a clean install of s2member and it didn’t work. He thinks it’s a database issue?

Possible. The only info in DB, used at this page, seems to be the custom field’s settings. So there is something, that JS can not “eat”…

Hi, I’m the junior developer working with Jai.
Just to summarise what I’ve tried already:
Local vccw vagrant box + fresh s2member + plugins as from site + original database from site = issue occurs

local box + original s2 member and plugins + clean database = issue doesn’t occur
Hence something in the database is interacting.

Yesterday, as per recommendations I ran auto-repair and the wp-optimize plugin on the original database; errors were identified and database recreated. The issue is still there.

Today I have been trying a temporary fix by adding Jquery in the theme via wp_enqueue_scripts() with Jquery as a dependency: http://wpbin.io/jzyss2 I also tried it the other way round with append and prepend before but as you suspected it looks like the interfering javascript is occurring before s2member loads?

Also, I’m using chromium and the error is as above.

Just run the JSON in the first div value attribute through JSON lint and it isn’t valid which explains the error. Are the fields generated by Javascript after this JSON value is valid?

Error: Parse error on line 1:
[{ & quot;section & quo
—^
Expecting ‘STRING’, ‘}’, got ‘undefined’

Also I used the delete all data advised uninstall process. Surely that config should have disappeared. Which table stores this value?

Thank you. For some reason when I uninstalled before all the data wasn’t deleted. Now it has deleted the config. I would still be grateful to know the table to potentially avoid deleting all members? Many thanks again for your help.

The info about custom fields is saved in wp_options and wp_usermeta tables - s2M don’t use additional tables. Hope that helps, somehow…

Also I think there is a problem with field’s names, values etc. Some of this info interacts with (or changes, or adds additional) JS or HTML code, thus you get JS errors on that page. I would suggest you to concentrate on fixing of those errors (which, I think, is not possible with adding additional JS code). But first check for “JS/HTML like” data in field’s info.