Forums Forums Search & Filter Pro Date UI field in search form causes undefined index error

Viewing 10 posts - 1 through 10 (of 13 total)
  • Trevor
    #205928

    If you have some dates already stored, you may need to check what data is stored in that field. To easily do this, take a look at this screenshot of my dev site admin screen for a form:

    https://www.screencast.com/t/PiQW6EnVVK

    Set your field up i the same way and click the Browse Values button to see what is stored. The dates must be in the format shown in my screenshot.

    What version of PHP are you using, and can you confirm you are using v2.4.6 of our plugin?

    Anonymous
    #206008

    Hi Trevor,

    I am using PHP 7.1.15 and yes, I’m using 2.4.6 of the S&F Pro plugin. I checked my database because I couldn’t find the value by setting up the post meta field like your example – and checked for a meta value of ‘first_date_from’ and ‘date_use_dropdown_month’, both with and without the preceding underscore – and those keys don’t exist in my database’s post meta.

    Would creating the key for _first_date_from with an empty value resolve the issue?

    Thanks.

    Anonymous
    #206010

    If it helps, I was using the non-PRO S&F plugin previously before I switched to PRO. I don’t know if perhaps the free version of the plugin saves things in the database for the date range field that may conflict with trying to set up a date range field in PRO?

    I was replacing the shortcode from the free version with the pro version, and both forms should have a date range. In the case of the free version, I had the date range set up as two text fields for the from/to date, format mm/dd/yyy.

    Thanks.

    Trevor
    #206016
    This reply has been marked as private.
    Anonymous
    #206054
    This reply has been marked as private.
    Trevor
    #206097
    This reply has been marked as private.
    Anonymous
    #206788

    Thank you for all of your time. While I still get the error, I’m going to just use the date range field with the “Use dropdown for Year/month” checkboxes checked. That seems to work fine. To re-create the fatal error, all you’d have to do is set up the Post Date field, and set it to “Date Range” and don’t fill out anything else for that field. Try to publish the form and you should see the undefined error.

    Thanks again!

    Trevor
    #206795

    I just tried that with my test site and didn’t get an error. I set it to use the same version of PHP also.

    How many fields do you have in the form?

    Anonymous
    #206911

    I have 6 fields.

    – Search
    – Post Type:
    Set to “Dropdown” and I changed the “All Items” to “All”
    – Category:
    Set to “Dropdown” with all items set to “All” and display count/hide empty terms/hierarchical/Include children checked
    – Post Date:
    Set to “Date Range” with Date Formar 03/28/2019 and only the “Use dropdown for year/month” checked
    – Sort Order:
    Set to “Dropdown” and All Items as “Relevance”. Sort options set as Title/Desc and Date/Desc
    – Submit button.

    I decided to simplify and try another test so I set up a new form. This time I didn’t touch any of the settings, and I just added a Search field and a Date field. Set the Date field to date range and didn’t mess with anything else. All the other settings on the Date field are empty or at their defaults. As soon as I tried to publish, I got the error again.

    The date_use_dropdown_year is specific to the PRO plugin, I searched my customized WP theme to make sure we didn’t have the same meta key for something else and we don’t.

    I also switched to a default WP theme (Twenty Sixteen) to see if it was theme related. I still get the same error.

Viewing 10 posts - 1 through 10 (of 13 total)