Skip Navigation

[Resolved] Displaying posts where one of the fields is null

This support ticket is created 8 years, 4 months 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 18 replies, has 2 voices.

Last updated by gavinS 8 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#356051

I would prefer if Minesh helped with this as he helped me with this problem so far.

This is a continuation of this thread:

https://toolset.com/forums/topic/only-display-posts-from-users-whose-email-matches-an-email-field/

I have just noticed that this view is not working properly now that I have moved it to my main site. Please allow me to send you login details privately.

#356077

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Please share link of the page where I can reproduce your issue.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#356230

Hmm.. This seems to be fixed now. Did you do something?

#356234

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've reopen this ticket as I can see that the issue is "posts_where" filter is not working that we've added to functions.php file where we apply the condition that we should only display posts where field called 'Job reference or reason' is empty.

Could you please try to resolve your issue by deactivating all third-party plugins as well as with the default theme to check for any possible conflicts with any of the plugins or themes?

#356248

Hi Minesh

I have deactivated all plugins besides Toolset.

I see that the leads are coming up in the view whether or not the job-reference-or reason field is null.

But I also see you have changed the code in the function, including this:

if($WP_Views->current_view == 9999)

Which wouldn't work, so I assume you're still working on it?

#356259

Hi Minesh

I just noticed that the Open Leads view had a filter set for Post Author to be the same as the current logged in user which is incorrect. I have removed this.

#356262

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes, that's changed by me. If will replace your original view ID and after that you will see that you will get different result as current view ID is not obtained at this point. Its strange that it was working with your previous site.

#356281

So what now? Are you still working on this to find a solution?

#356513

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

1)
I would like to know that the code that is added to your previous site is still working?

2)
Could you also try to check your issue with default theme?

#356807

Hi Minesh

1) The code does seem to be working on the other site.

2) I have changed the theme to the original 'Starter' theme instead of 'Starter Child' and added the code to functions.php and it has the same problem. I don't get it. It's the same theme on both sites..

#356817

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Something is really causing this and its really strange that code is working on one site and not on another.

What if you try on some clean install? does this issue happens with clean install as well?

#357041

Hi Minesh

I was just going to try and copy the changes I've made in the Child theme over to the other test site to see if I could recreate the problem and isolate what is causing it. However, when I tried to reactivate the Starter Child theme I just get this error message:

Fatal error: Cannot redeclare posts_where() (previously declared in /home/gammamag/coastline/wp-content/themes/toolset-starter-child/functions.php:68) in /home/gammamag/coastline/wp-content/themes/toolset-starter/functions.php on line 252

Please enable the Private message so I can send you ftp details.

Thanks

Gavin

#357065

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#357237

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Unfortunately FTP access details are not working at this end. What I can suggest you should login to your FTP and open functions.php file and go to line number 252 and remove posts_where filter you have added and try to check if your site back to work.

Also, please don't forget to send me FTP access details again.

#357379

Hi Minesh

Whoops, sorry. My host provides FTP Access Control which is set by default to only allow access from South Africa. I have allowed access from India (I'm assuming that's where you are??).

I have tried adding all the same changes I've made to styles.css and functions.php to the top1 site and it still works. The only other difference I can see is the conditional on the coastline site, which I commented out and it still didn't work.

I haven't tried a clean install. I'm hoping it doesn't come to that as I'd hate to start again. But I guess if I have to I have to..

Thanks

Gavin

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.