getting fatal error after marketpress update

Hello, I have been unable to update to any marketpress after 2.9.6 because it would break my site. Now I have a staging site to play with so once I can figure out what is going on, I'll be able to push it live. Yay...... so in the meantime, I am getting this fatal error on all subsites and can't get to any sub site dashboard to update their marketpress store. Fatal error: Call to a member function add_cap() on a non-object in /nas/content/staging/ecraft/wp-content/plugins/marketpress/includes/common/class-mp-installer.php on line 903
I already updated the network marketpress settings and disabled the theme and all plugins one by one to see if there was a conflict. Nothing....error still persists. Hoping to finally get this resolved so I can update live and get all the great new marketpress features. I've granted access.

  • Nastia

    Hello @leslie_diederich

    I'm sorry to hear you have this issue!

    Would you please rename the MarketPress folder the in .../wp-content/plugins/... directory and upload a fresh copy of the plugin via FTP or File Manager from your cPanel?

    - Download a copy of the plugin form Marketpress page
    - Navigate to /wp-content/plugins/ directory
    - Locate and rename the marketpress folder
    - Upload the newly downloaded plugin

    In case this will no fix the issue, please enable WprdPress debugging. Put the following code inside wp_config.php file:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );

    Activate the plugin again, and once you get the Fatal Error again, please navigate to to /wp-content/ and attach here the debug.log file, wich you find inside the folder.

    Have a nice day and take care :slight_smile:

    Cheers,
    Nastia

  • Tyler Postle

    Hey Leslie,

    We're going to need to do further testing. Do you mind sending in your wp-admin credentials and FTP for your staging site? Then we can troubleshoot further and get this sorted out :slight_smile:

    You can send that privately through our contact form: https://premium.wpmudev.org/contact/

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me.

    Send in:

    Subject: "Attn: Tyler Postle"
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    **If you keep support access active then no need to send in wp-admin

    Look forward to hearing back.

    Cheers,
    Tyler

  • Leslie

    Making some progress but still need significant help. After backing up staging site, I cleaned up the database getting rid of all unused plugin tables. The fatal error was coming up on some sites but not all. Here's the fatal error again: Fatal error: Call to a member function add_cap() on a non-object in /nas/content/staging/ecraft/wp-content/plugins/marketpress/includes/common/class-mp-installer.php on line 903

    Found this thread (https://www.designwall.com/question/fatal-error-on-install-call-to-member-function-add_cap/) with a similar problem so I tried the solution posted in the thread by adding this code above line 903 in the above marketpress file if( ! $role ) continue;
    The fatal error went away and I was able to get on the dashboard of the affected sub sites. However, now getting a new error on the affected sub site dashboards: supplied for foreach() in /nas/content/staging/ecraft/wp-content/plugins/marketpress/includes/admin/store-settings/class-mp-store-settings-capabilities.php on line 41 so not sure if my solution can be tweaked or what. I also noticed that marketpress now has a user capabilities tab. I noticed that on the affected subsites with the fatal error, that screen is missing. On subsites with no fatal error, I can see a screen that says subsite user capabilities and I can check mark whatever I want. Does this have to be done for each subsite or is there a default for user cabability for subsite admins? I would hate to have to go into each store and check mark a bunch of capabilities that they should have by default anyway as subsite admin and it would be a lot of work for me with over 80 subsites.

    In addition to this error, I am having the following problems:
    1. paypal address under payment settings for sub sites is gone after updating. Need to manually add to all subsites.
    2. Sub sites that haven't been updated yet are showing up on main site with their products priced as $0.00 so again, need to update each individual store. thinking that once updated, the prices will show up correctly on global store page. So far it looks to be fixing that as I update stores one by one.
    3. Check out how the global products are displaying on these pages. http://ecraft.staging.wpengine.com and http://ecraft.staging.wpengine.com/store/

    On the home page under browse, the 2nd tab especially doesn't look good with images being too big and they don't line up that well. So need some coding to make it look a lot better. Same thing on the global store page, I'd like to get them to be uniform so that if someone put's a longer title, it should automatically stop the longer title so that each product post is the same size.

    So far, I am so overwhelmed by updating marketpress beyond 2.9.6 and the promised global cart with paypal chained payments is not available. That was promised to be included on the (big) update years ago on many threads. Some of those threads were mine but I read many from other members that wanted that feature too. Why was that not included on this big update (3.0)? Will it ever be offered? Please help, I have been working on this for days and haven't heard back for awhile now.

  • Tyler Postle

    Hey Leslie,

    Apologies for my delay on this. Thanks for sending in your login.

    I've sent that fatal error to the developer. I'm not able to replicate it myself still, but there must be an issue during the upgrade.

    Thanks for the info above too, I've included that for the developer, they should be able to find a fix that won't result in further errors.

    Does this have to be done for each subsite or is there a default for user cabability for subsite admins?

    By default subsite admins can access all the settings. That User Capabilities page is just to control the MarketPress capabilities for users below the admin level.

    1. paypal address under payment settings for sub sites is gone after updating. Need to manually add to all subsites.
    2. Sub sites that haven't been updated yet are showing up on main site with their products priced as $0.00 so again, need to update each individual store. thinking that once updated, the prices will show up correctly on global store page. So far it looks to be fixing that as I update stores one by one.

    Yes, you need to run the DB update for each store. This only needs to be done once each store, the subsite admin can also run this update. We considered having it update all at once, but we found it could end up overloading users servers which would create a bigger problem, so this was the lesser of two evils.

    On the home page under browse, the 2nd tab especially doesn't look good with images being too big and they don't line up that well. So need some coding to make it look a lot better.

    Try this code here:

    .mp_product_image_list.photo {
      height: 216px !important;
      width: 216px;
    }

    That will make all your images forced to the same size. It's best to upload them at that size as well so they don't need to be distorted or cropped to fit within the image placeholder. It looks like majority of your store images were already that size :slight_smile:

    If you don't have a custom CSS sheet already you can use this plugin here: https://en-ca.wordpress.org/plugins/simple-custom-css/

    Why was that not included on this big update (3.0)? Will it ever be offered?

    We had issues with it during initial testing in MP3.0 and it was going to take awhile longer to make sure it works properly, with so many members waiting for MP3.0, we decided to release it without it then add it in later. It's definitely going to be included again, it's being worked on right now. We have hired a new developer that took over lead dev position of MP last month, so expect an update soon.

    Any further questions in the meantime, just let me know. Apologies again about my delay.

    Talk to you soon.

    Cheers,
    Tyler

  • Leslie

    Thanks for the detailed reply. I will await what the developers figure out about the fatal error. I have another issue with this update that may be related to the fatal error or may not. I was signed in as a subsite admin checking something else and I couldn't access store settings. I was getting the ""you don't have permissions to access this" error but was not getting that error when I was signed in as super admin. I then reverted back to marketpress 2.9.6 and was able to as sub site admin view the store settings tab and all that goes with it like presentation, payments etc.... I also checked the user role on the sub site and the sub site admin had the administrator role and was able to access all other tabs on dashboard like add new post, page, upload media....just not the store settings of marketpress. In addition, sub admin was able to add new products, edit products etc.... just not access the store settings tab.

  • Leslie

    Just wanted to give an update. I updated the latest version of marketpress 3.1 tonight and received the same fatal error as reported above in my original question. I inputted the following code above the line that is in the fatal error. With this update I had to input the code above line 914
    if( ! $role ) continue;

    the fatal error went away and marketpress and the entire site is working fine.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.