Skip Navigation

[Resolved] Is it possible to avoid duplicate value submission for any CPT field ?

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Author
Posts
#603399

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

That plugin does not work with multisite.

I tried using FTP access but the credentials you supplied did not work.

Can we try something else.

Can you install the following plugins:

ARI Adminer
Query Monitor
WP Log Viewer
Code Snippets

Where you have added the code I supplied (I'm guessing to your theme's functions.php file), can you remove it? I will add it via the Code Snippets plugin where I may add some additional lines for testing.

If you haven't already, turn on the debug log by editing your wp-config.php file and change the line with WP_DEBUG like so:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

Let me know when you have done that.

#603422

Hi ..As per your instructions I have completed all tasks.Plz proceed for next steps...

#603429

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry, I realise I gave you generic code and never got the specific details from you.

What do I need for these lines of the code?

    $post_type = 'cpt-slug';  // Edit
    $unique_field = 'wpcf-' . 'field-slug';  // Edit
    $form_ids = array( 101, 115 );  // Edit IDs of CRED forms
#603435

Here is the code ....

 
$post_type = 'college';  // Edit
$unique_field = 'wpcf-' . 'college-code';  // Edit
$form_ids = array( 7676 );  // Edit IDs of CRED forms
#603719

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I have done some more testing but have reached something of an impasse.

I can see the issue on your site and the PHP warning in the logs, but without further testing in a local environment I can't identify the source of the warning.

I cannot reproduce the warning on a local test site, and I thought it may be limited to when running this on a multisite installation. So I created a multisite test install and reproduced the set up to test the same code with a CRED form to prevent duplicate submissions, but it again worked as expected without producing any PHP warnings.

So the issue seems to be specific to your installation.

The warning doesn't appear to be affecting the functionality, the CRED form submissions work and the code I provided prevents duplicate submissions, but to be able to debug this any further I will need a working copy of your site that I can install locally. Let me know if you are able to provide such a copy, I'll try to work with whatever tool you use.

#603722

Okk...sure.How to provide duplicate copy?

#603724

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

We tried duplicator to extract the single site but that failed. I could try duplicator pro but for that I'd need to install it, which means you giving me super admin access to be able to install the plugin on the network.

Otherwise you can search for other backup and site transfer plugins that work with multisite and try one of those.

#603733

You already have super admin permissions....so plz try as per your requirement...

#603794

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I again took a duplicate of your site and tried to install locally and again failed.

The site installs, or appears to install correctly, and can be visited on the front-end, but access to the back-end is impossible.

I've consulted with colleagues but no-one can account for it.

There is nothing more I can do, I'm afraid, unless you are able to provide me with a working copy of your site.

If Duplicator doesn't work I don't know what to suggest, but if you find a solution that you test and works please let me know and I can proceed.

#603795

Okk....i will try to provide you working environment....

#603806

Hi Nigel !
By changing php version my issue is resolved.I was using php 7.....by changing it to 5.6 error is gone.Again if in future If I need to use php 7...what will be the solution
and
Thank you for your sincere efforts.