Title: Fatal error: Uncaught Exception: Invalid attribute: payment_items
Last modified: November 6, 2017

---

# Fatal error: Uncaught Exception: Invalid attribute: payment_items

 *  Resolved [jomo](https://wordpress.org/support/users/jonathanmoorebcsorg/)
 * (@jonathanmoorebcsorg)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-invalid-attribute-payment_items/)
 * 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](https://wordpress.org/support/users/jonathanmoorebcsorg/)
 * (@jonathanmoorebcsorg)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-invalid-attribute-payment_items/#post-9655039)
 * 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](https://wordpress.org/support/users/jonathanmoorebcsorg/)
 * (@jonathanmoorebcsorg)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-invalid-attribute-payment_items/#post-9655606)
 * 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](https://wordpress.org/support/users/jonathanmoorebcsorg/)
 * (@jonathanmoorebcsorg)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-invalid-attribute-payment_items/#post-9655786)
 * 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](https://wordpress.org/support/users/businessdirectoryplugin/)
 * (@businessdirectoryplugin)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-invalid-attribute-payment_items/#post-9655935)
 * Hi [@jonathanmoorebcsorg](https://wordpress.org/support/users/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](https://wordpress.org/support/users/jonathanmoorebcsorg/)
 * (@jonathanmoorebcsorg)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-invalid-attribute-payment_items/#post-9657281)
 * 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](https://wordpress.org/support/users/businessdirectoryplugin/)
 * (@businessdirectoryplugin)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-invalid-attribute-payment_items/#post-9657321)
 * 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.

 * ![](https://ps.w.org/business-directory-plugin/assets/icon-256x256.png?rev=2901888)
 * [Business Directory Plugin - Easy Listing Directories for WordPress](https://wordpress.org/plugins/business-directory-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/business-directory-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/business-directory-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/business-directory-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/business-directory-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/business-directory-plugin/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Business Directory Plugin](https://wordpress.org/support/users/businessdirectoryplugin/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-invalid-attribute-payment_items/#post-9657321)
 * Status: resolved