• Resolved jomo

    (@jonathanmoorebcsorg)


    Is it actually impossible to submit Free listings in the new version?

    errors eg:

    Fatal error: Uncaught Exception: Invalid attribute: payment_items in /wp-content/plugins/business-directory-plugin/includes/db/class-db-model.php:133 Stack trace: #0 /wp-content/plugins/business-directory-plugin/includes/class-listing.php(555): WPBDP__DB__Model->__get(‘payment_items’)
    #1 /wp-content/plugins/business-directory-plugin/includes/views/submit_listing.php(743): WPBDP_Listing->generate_or_retrieve_payment()
    #2 /wp-content/plugins/business-directory-plugin/includes/views/submit_listing.php(99): WPBDP__Views__Submit_Listing->save_listing()
    #3 /wp-content/plugins/business-directory-plugin/includes/class-dispatcher.php(75): WPBDP__Views__Submit_Listing->dispatch()
    #4 /wp-includes/class-wp-hook.php(298): WPBDP__Dispatcher->_execute_view(”)
    #5 /wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
    #6 /wp-includes/plugi in /wp-content/plugins/business-directory-plugin/includes/db/class-db-model.php on line 133

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter jomo

    (@jonathanmoorebcsorg)

    it doesn’t look like save_listing() is designed to cope with free listings, inasmuch as it is requiring a valid payment object to continue…

                $this->listing->set_status( 'pending_payment' );
                $payment = $this->listing->generate_or_retrieve_payment();
    
                if ( ! $payment )
                    die();
    
                $payment->context = is_admin() ? 'admin-submit' : 'submit';
                $payment->save();
    Thread Starter jomo

    (@jonathanmoorebcsorg)

    I think the errors were partly due to a database refresh and the database upgrade not being run.
    Resolved by rolling back and re-upgrading

    Thread Starter jomo

    (@jonathanmoorebcsorg)

    for example, if doing a data restore from live to live copy for upgrade testing, I do NOT copy the wp_options table since this can causes a lot of problems copying live settings to non-live environment. Therefore the options table is left updated with the new settings and not caught by test like:
    // Post-install migrations.
    if ( get_option( ‘wpbdp-migrate-18_0-featured-pending’, false ) ) {

    Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    Hi @jonathanmoorebcsorg,

    Sorry that you ran into issues here!

    I’m not clear on a lot of things so let’s start with some basics:

    Can you tell me a bit more?
    – What version of WP are you running here?
    – What exact version of BD? (number, please)
    – What did you do to submit the listing? (Admin side, user side?)
    – Who were you logged in when you submitted the listing?

    We haven’t had a report of that specific issue yet, so it would help to understand how this happened first…

    Thread Starter jomo

    (@jonathanmoorebcsorg)

    Hi, I set this thread to resolved myself, as it was due to my test setup, testing upgrade from 4.1.15 to 5.0.4.

    I believe the issue can occur in several ways, for example:

    • Upgrade to BD 5.0.4
    • Update test data by refreshing all tables – except wp_options
    • Database upgrade script is not run as the setting is still there in wp_options

    This also applies when performing rollback to previous BD version and upgrading again.
    This is particular to the refresh method so can be ignored.
    Though I do highly recommend never to include wp_options in refresh scripts as it’s too dangerous – at some point there will be an oversight and the test system will accidentally email live customers / republish information from test system etc etc. Probably automatically by cron before anyone has time to do anything about it.

    Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    Hi Jon,

    Yes, we found a bug in 5.0.4 that did not run all upgrades and wait until they completed. This is fixed in 5.0.5, now publicly released.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Fatal error: Uncaught Exception: Invalid attribute: payment_items’ is closed to new replies.