• Resolved KingDingbat

    (@kingdingbat)


    Hello!

    I have been testing out directory plugins for a couple days and settled on Directorist, but after a day or so of successful trying, it has stopped working.

    When I try to save edits to an existing listing, I get “There has been a critical error on this website. Please check your site admin email box for instructions.”
    When I click on “Add Listing” in the menu, the page does not load completely (it is just a text field and the above error message on the page)

    WordPress version 6.2.2
    Active theme: Travel Agency Pro (version 2.2.6)
    Current plugin: Directorist – Business Directory Plugin (version 7.6.1)
    PHP version 7.4.33

    Error Details
    =============
    An error of type E_ERROR was caused in line 1001 of the file <site home directory>/wp-content/plugins/directorist/includes/helper-functions.php.
    Error message: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (P9999999999999999D) in <site home directory>/wp-content/plugins/directorist/includes/helper-functions.php:1001
    Stack trace:
    #0 <site home directory>/wp-content/plugins/directorist/includes/helper-functions.php(1001): DateInterval->__construct()
    #1 <site home directory>/wp-content/plugins/directorist/includes/classes/class-metabox.php(426): calc_listing_expiry_date()
    #2 <site home directory>/wp-includes/class-wp-hook.php(308): ATBDP_Metabox->save_post_meta()
    #3 <site home directory>/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #4 <site home directory>/wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 <site home directory>/wp-includes/post.php(4671): do_action(

    I cannot figure out what I may have done to cause this, and I’ve done some troubleshooting already with no luck.
    1. I have tried disabling all plugins except for Directorist
    2. I have tried uninstalling and reinstalling the plugin.
    3. I’ve tried disabling my theme and running only the Twenty Twenty Three theme.
    4. I’ve updated to the latest version of WordPress
    I do have one suspicion, but it’s unlikely: When I previously added a location with a special character. “Pāhoa” in the location sections of the Directorist plugin, it did not display correctly and was instead “P?hoa”. I went in and manually changed the location to “Pahoa” and this vaguely feels like it may have been when I started having trouble. Should I try dropping my database tables for Directorist? That’s the only step I haven’t tried yet.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter KingDingbat

    (@kingdingbat)

    I figured it out. Of course, as always, I tend to stumble upon the cause after spending hours troubleshooting, and another hour writing a detailed help post ??
    The issue is from the “General” tab of the Directory Builder.
    In my testing, before I had discovered the “never expire” checkbox on the listing editor, I set the Expiration setting in the Directory Builder to “999999999999999999” because I didn’t want my listings to expire.
    Screenshot: https://i.imgur.com/mQXipEX.png
    This causes a problem with the plugin, and setting it to a more reasonable value like “50” makes the problem go away and Directorist works fine again.
    I knew that this must have been something to do with a setting because the plugin worked fine for a long time before I poked around and changed settings.
    I didn’t get any error message or anything when setting the Expiration field to “9999999999999” – perhaps in a future update you can set that field to a maximum value and/or add a invalid number error message.

    Plugin Support Mahfuzul Alam

    (@mahfuz87)

    Hi @kingdingbat

    Thank you for contacting us. We will try to update this setting in future updates. For now, you can use the following codes to set “Never Expire” when importing listings or creating a listing. Please use the codes end of the functions.php file in your currently activated theme folder or you can use any code snippet plugin to implement the codes as well.

    /**
    
    * After imported the listing using CSV file
    
    */
    
    add_action('directorist_listing_imported', function ($post_id) {
    
    update_post_meta($post_id, '_never_expire', 1);
    
    });
    
    /**
    
    * After Created a listing
    
    */
    
    add_action('atbdp_after_created_listing', function ($post_id) {
    
    update_post_meta($post_id, '_never_expire', 1);
    
    });

    Please inform us if you need further assistance.

    Kind Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Critical Error when trying to edit/add listing’ is closed to new replies.