• Resolved AWOL

    (@awol)


    Hi,
    I really like the plugin, but I am having some difficulty with the Data Sources and Grids concerning filters. I don’t know if this is because of me, your plugin or the plugin that created the custom post type and associated custom fields, categories and taxonomies, but I suspect that it is either me or the other plugin.

    So my question is about the Terms filter; I choose Posts as the Data Source, and then the post type of the other plugin (this is for a Checkbox field). What I want to achieve is to show in the form all the posts authored by the current user (and I can tick that box) in that post type, but filtered by particular categories, and I assumed that this is what the Terms filter is for (please correct me if I am wrong). However any search I put in for terms I know are valid comes up with ‘no results found’ (I know they are valid because if I ‘Get Data’ for just the post type and include ‘Terms’ in the Columns list, that column is populated with the terms I am searching for in the filter). In addition, I want this to be a generic form that will check and filter all the relevant categories whichever user is using the form (I have set it so that only users with relevant posts can see the form, but I obviously don’t know which categories each user has posts in and once operating this could change minute by minute), so how can this be achieved if it won’t allow me to enter the filter terms even when I do know the terms? I am very puzzled.

    To explain a little further, the other plugin (Classified Listing) is to let people post classified ads on the front end, and I have hacked the template to add 3 forms to it, which display depending on which user is viewing, what they are viewing, if they are the author etc; I have three ‘types’ set up in the CPT (the plugin default is 5 with names like Buy, Sell, Rent etc, but these can be changed to whatever you want or dispensed with entirely), two of which are set up with only 1 category each, but one of them has about 40 categories/sub cats – I want to show this one only. The types are some form of weird taxonomy (I think) set up by the plugin, more like some kind of custom field, but no other plugin I have used in conjunction ever detects them, but the categories are detected, and in your plugin, if I choose Data Source as Terms, I can get the data of the categories, so I don’t understand why I can’t add these terms in the filter when the Data Source is Posts. Do I need to add some kind of code to my functions to fix this? Sorry to be a pain!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Mark Westguard

    (@westguard)

    Hi!

    Thanks for your inquiry.

    Are you using the LITE or PRO version of WS Form?

    Thanks!

    Mark

    Plugin Author Mark Westguard

    (@westguard)

    I did just check this out for you. I added:

    – A location
    – A category (Under Sell)

    I was able to search for both of these as terms in the Post data source without a problem. Our term search actually does a SQL search of all the terms in the database so there should be nothing that would prevent these terms from being filtered.

    I tried this with the LITE and PRO versions and both worked fine.

    The Sell, Buy etc categories do not appear to be WordPress terms, but you may wish to reach out to the plugin developer to confirm this.

    There should not be any code you need to add.

    If you could send an export of your form to [email protected] we’ll be happy to take a look at it to investigate further.

    Thanks!

    Mark

    Thread Starter AWOL

    (@awol)

    Hi @westguard ,
    Thanks again for your amazingly fast response – you put many other plugins to shame, as I frequently wait days or weeks to get a reply. I am using the Lite version incidentally.
    Just for me to be completely clear, you were able to input a term into the search box that appears under the Filter by Term section and it was recognised and entered into the filter? Because this is the stage that is failing for me, it never recognises the term, so I can’t go any further.

    Could this be caused by a conflict with another plugin? I do have Contact Form 7 and a couple of associated plugins installed as that was my original way of doing this, but I ran into some different issues with it that had me searching for a replacement. I will try deactivating them to see if anything changes.

    I will update here if I discover anything.

    I am also going to check if there is anything I have done in my hacks of the other plugin (in my child themes folder) that would impact on this, but as far as I remember I have only fiddled with templates.

    Plugin Author Mark Westguard

    (@westguard)

    That’s correct, I did as you describe and it worked ok.

    A couple of thoughts:

    1. I wonder if another plugin is clashing with ours and affecting our ability to use Select2 on that search field? We are very careful to only load third party libraries on our admin pages but we’ve seen some other plugins just blanket load what they need on every admin page and that can sometimes cause problems.

    2. It might be worth checking the browser inspector for any errors when you search to make sure a security plugin or something else might be blocking the search. Does it say ‘No results found’ after you search?

    3. What type of computer (Mac/PC) and web browser are you using?

    Thanks!

    Mark

    Thread Starter AWOL

    (@awol)

    Hi @westguard,
    To answer your points 2 and 3; The browser inspector isn’t showing any errors, and yes, I get ‘No results found’; I am on a Mac using Firefox. But I just tried on Safari and it is the same.

    Is there any way I can check if any other plugin I am using is blanket loading? What should I search for in the plugin files (I have them on my computer so I can search for any term that would appear).

    So far I have gone through the additions in my theme functions to see if anything there is interfering, and deleted any CF& stuff, and deactivated CF7 and any connected other plugins. I have checked the template relating to where the forms are embedded as well. So far nothing has had any effect.

    Thread Starter AWOL

    (@awol)

    Hi @westguard,
    OK I have just gone through the process of deactivating all plugins, except yours and Classified Listing, to see if it is another plugin causing this, and the answer is no. I also reverted to the default theme (the 2021 WP one) and no difference there either. Given that it worked at your end with whatever setup you have, I am at a loss to explain what is the problem, so any other possible suggestions you have I am all ears. The only difference I can think it could be now is that I changed the names of the listing types in Classified Listing from the default, plus obviously my other settings and setup in that plugin. I will have a look in there to see if one of those changes anything.

    Thread Starter AWOL

    (@awol)

    Hi @westguard,
    Just some further info in case it helps solve this issue; I checked the error log, and found the following line for every search I attempted (I have replaced the actual database table name with MYDBTABLE) –
    [04-Nov-2021 09:58:50 UTC] WordPress database error Table 'MYDBTABLE.wp_terms' doesn't exist for query SELECT DISTINCT t.term_id, t.name, tt.taxonomy FROM wp_terms AS t LEFT JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE ((t.name LIKE 'books%') OR (t.slug LIKE 'books%')) ORDER BY t.name ASC made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WS_Form_Data_Source_Post->api_term_search, WS_Form_Data_Source_Post->term_search

    If this tells you anything please let me know; I don’t know a huge amount about how error messages are generated, but one thing that immediately strikes me is that all my database tables are prefixed with ‘wplx’ not ‘wp’ so it would be understandable that the table cannot be found and the search fails. I can’t find anything in the settings for your plugin regarding the database, so is it possible that somehow the proper prefix was not picked up when the plugin was installed? I am going to delete your plugin and all the tables (after exporting the created forms) and then will reinstall to see if that fixes the problem, and will let you know.

    Plugin Author Mark Westguard

    (@westguard)

    Excellent detective work! We’re going to check that right now! We do take into account custom database table prefixes, but we’re going to double check that particular query.

    Thanks again!

    Plugin Author Mark Westguard

    (@westguard)

    Thank you again for providing the debug output and I apologize for the inconvenience caused. We did find 2 references to the table names that were not using $wpdb->prefix. We have fixed this and pushed the latest LITE version (1.8.133) which should hopefully solve this conundrum!

    I am extremely grateful for your help!

    Please let me know if this latest version fixes this particular issue.

    Best wishes

    Mark

    Thread Starter AWOL

    (@awol)

    Well done! The issue is fixed. And thank you.
    And sorry for being a pain, but I have another question related to the same area; with the Data Grid, I know I can pull a label (in my case the post title) into the form, but is it possible to pull another field as well to display next to/under the label in the form? I have a meta value that I would like to do this with but so far I can’t find a way to get it to show, and it would need to work if more than one selection was made as well. I am guessing it might be beyond the scope of the plugin, but I’m hoping there is a way as the data can be shown in the grid.

    Plugin Author Mark Westguard

    (@westguard)

    Great to hear the issue is fixed!

    Our PRO edition has conditional logic that could allow such logic to work.

    You can learn more about it here: https://wsform.com

    Feel free to email [email protected] with any questions about the PRO edition and we’ll be more than happy to assist you further!

    Thread Starter AWOL

    (@awol)

    OK thanks; I will have to wait both until I have funds to invest in the PRO version, and if my project generates any such funds once it launches. I really appreciate such great support for the free version though.

    Plugin Author Mark Westguard

    (@westguard)

    Best of luck with your project and thank you so much for taking the time to write us a review, much appreciated!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Questions about Data Sources and filters’ is closed to new replies.