WP Finance
[resolved] Multisite Issues (4 posts)

  1. iDesignCo
    Posted 2 years ago #


    I seem to be having a similar issue described here:

    However this is off of a clean install (didn't update the plugin from an older version). The sums show up, but in a sub-site the list just says "No Data". However if I look at the DB table, I can see the entries for the income/expenses I've added.

    It does, however, work fine on the main site. Additions appear both in the list and in the sums.

    I've also noticed that it seems to be messing up the styling on other WordPress Admin pages. I'm guessing this is due to the styling being queued to the wp-admin without checking to see if it is the finance page. Nothing major on that part asofar, but it shouldn't be happening.



  2. iDesignCo
    Posted 2 years ago #

    Good news.

    I figured out the issue. It was in /wp-finance/components/wpf_default.php

    You use $wpdb->prefix to grab the table prefix for the site, which works fine for everything on a single-site installation. However on a multisite installation, you're trying to use it for users, which is what's breaking this.

    It's trying to load wp_3_users when it should be loading wp_users on a multisite installation. Using wp_3_ as the prefix works for the rest of the time, because the finance table is with that prefix, but the users table is still in the main WP table.

    So by changing in lines 138-139 in that file from:
    $wpdb->prefix."users to $wpdb->base_prefix."users
    to select the users instead, the plugin loads content fine in a sub-site.

    Hope this helps anyone else with this issue.

  3. iDesignCo
    Posted 2 years ago #

    There are additional references to the user table, so instead of just on those two lines, replace any instance of $wpdb->prefix."users with $wpdb->base_prefix."users.

    That'll make it all work for multisite.


  4. mch0lic
    Plugin Author

    Posted 2 years ago #

    Hi iDesignCo,

    So basically using $wpdb->base_prefix will sort all multisite problems? Will try to add patch asap :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Finance
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic