• Toby

    (@tobyhawkins)


    Using v2.1 Buddypress and v1.6 Buddypress Activity Plus and unfortunately IE8 as it’s the company standard browser.

    Uploading photos works fine. With documents, the document appears to upload, then you hit ‘add documents’ and everything disappears. Can’t find the file in the file structure using FTP either.

    Any suggestions of fixes or even how I might go about debugging would be welcomed.

    Works fine in Chrome.

    Thanks.

    https://www.ads-software.com/plugins/buddypress-activity-plus/

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter Toby

    (@tobyhawkins)

    Sorry, it’s not IE8. It’s an admin/member issue.

    Admin can upload the document but normal member can’t. I’ve tried going into BP Group Documents and making sure that the moderator can decide who uploads and setting group upload settings to all members, but no dice.

    Thread Starter Toby

    (@tobyhawkins)

    Ok I narrowed it down to the function bpfb_documents_allowed in lib/bpfb_group_documents.php

    I haven’t worked out why, but bp_group_is_member() isn’t working in this function.

    If you replace bp_group_is_member( $group ) with groups_is_user_member( bp_logged_in_user_id(), $group->id ) everything works fine again.

    Thread Starter Toby

    (@tobyhawkins)

    Sorry. Typo. Should have been bp_loggedin_user_id().

    Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi Toby,

    Thanks for posting on the forum.

    I could reproduce the issue on my test site using latest versions of all plugins and WordPress.

    I could also confirm the solution you have posted in this topic could fix the issue.

    I have notified the plugin developer about this issue so that it can be fixed.

    Your help here is really appreciated.

    Have a fantastic day!

    Thanks,
    WPMU DEV

    The problem is caused by the upgrade of BuddyPress to 2.0 later version.
    Before 2.0 version, BP_Groups_Group class can get all data of a group.
    After 2.0 version, for performance reason, BP_Groups_Group class only get part of data without populate_extras parameter.
    Change the code in the function bpfb_documents_move to below, then bp_group_is_member function can be kept without change to Toby’s method.
    $group = new BP_Groups_Group((int)@$_POST[‘group_id’],array(‘populate_extras’=>true));
    Toby’s method also works well by the way.

    Thread Starter Toby

    (@tobyhawkins)

    @yzqiang’s fix works with the latest version of Buddypress Activity Plus (1.6.1) and the latest version of BP Group Documents (1.9.1) but I have only tested with Buddypress v2.1.1. I haven’t been able to upgrade Buddypress to v2.2.0 yet. Will report back when I do.

    Hi, I am pretty sure that i need to do this to fix my current problem but i dont know where the file I am meant to be editing is, can you please explain it to me like im a 5 (well a webmaster rather than a coder, if i know where it is I can get it done) ??

    Thanks in advance

    Thread Starter Toby

    (@tobyhawkins)

    The best way to do it would be edit the file locally and then upload via FTP. You can edit the plugin files directly via the WordPress backend, but things can go screwy more easily that way.

    The file you want is wp-content > plugins > buddypress-activity-plus >lib > bpfb_group_documents.php

    To make yzqiang’s change, you need (in my version at least) line 132.

    I have actually just managed it and now documents are working.

    BUT

    now when i upload the documents they do not show in the groups feed, only in the documents tab.

    Any ideas?

    Hi, now I’ve the same problem in my site than rhysbonney, the document upload (using yzqiang’s fix) and the activity loop show the documents uploaded by the super user, but not the documents uploaded by members.

    Buddypress 2.2.0
    BP Group Documents 1.9.1
    Buddypress Activity Plus 1.6.1

    regards.

    Thread Starter Toby

    (@tobyhawkins)

    It’s not working in BP 2.2.x for me either.

    Debugged it as far as bp-activity-classes.php in the save function. For some reason, $this->component is being unset when the script is running do_action_ref_array( ‘bp_activity_before_save’, array( &$this ) ) and it’s setting $this->type instead. And then the next if statement if( empty( $this->component ) || empty( $this->type ) ) is evaluating to true and returning false without saving the activity.

    I can’t work out where or why this is happening though. Will be able to give it some more time tomorrow, but if anyone knows why this is happening that’d be grand.

    I had a look myself and cant work it out but I am fairly new to this whole thing, if you work it out, you will be a life saver!

    Thread Starter Toby

    (@tobyhawkins)

    Got it!

    It appears that buddypress have fixed an issue with bp-core-moderation where the function bp_core_check_for_moderation was bailing too soon if there are no blacklist moderation keys (which there aren’t by default).

    This means that buddypress activity updates are now being checked for the number of links (where it seems they weren’t before?) and bailing (with no errror!) if there are more than 2 (the WP default). As the group documents by default includes at least 3 links in the activity update it bails and doesn’t save the activity (despite saving the document). Just upping the limit to 3 might not help as every extra document adds another link, but it could be a useful temporary fix – you can do this in Admin > Settings > Discussion. Note that the setting is >= (i.e. if you want 3 links set the limit to 4 etc).

    As for a more permanent fix, I think that will need to be done by the plugin authors. There doesn’t actually seem to be a limit to the number of documents you can add, which would possibly be helpful? You might be able to count the number of documents being uploaded and filter the number of links allowed using ‘comment_max_links_url’?

    Thread Starter Toby

    (@tobyhawkins)

    Also, I wonder if a moderator could change the title of this post? The problem has nothing to do with IE8 and it’s a little embarrassing seeing the fruits of my haste to post without fully checking the problem whenever I look at this post ??

    Hi Toby,

    your fix works for me, thank you very much for sharing it, you’re a debugging boss.

    Regards.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Documents upload not working in IE8 with latest BuddyPress’ is closed to new replies.