BuddyDev

Search

Mediapress breaks the cropping function of Buddypress

  • Keymaster
    (BuddyDev Team)
    Posts: 21846
    Brajesh Singh on #2536

    Thank you. I will be looking at it and will get back to you soon.

  • Participant
    Level: Initiated
    Posts: 6
    Ross on #2575

    Perhaps there is an easy to way to remove the google viewer functionality in mediapress to not conflict with the one I use. I don’t intend to use mediapress for anything other than photos.

  • Keymaster
    (BuddyDev Team)
    Posts: 21846
    Brajesh Singh on #2577

    Hi Ross,
    I am sorry for the delayed reply. I have been looking at MediaPress code as well as the other plugins code.

    MediaPress does not load anything for documents on any page other than single doc page, so that is not the reason.

    I looked further and I have found what is causing issue. It is pdfmake included with the inline document plugin.

    When MediaPress is active and “pdfmake” is loaded, The cropper does not appear. It is not throwing any js error or anything, so it is really difficult to debug after that.

    Try commenting these two blocks in the inline google document plugin

    
                // PDFMake (required for DataTables' PDF buttons)
                'pdfmake' => array(
                    'src' => '//cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js',
                    'deps' => array('datatables-buttons')
                ),
    			
                'pdfmake-fonts' => array(
                    'src' => '//cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js',
                    'deps' => array('pdfmake')
                ),
    

    And you will see that the cropper works.

    I will be looking further but I am not sure what is causing this issue.

  • Keymaster
    (BuddyDev Team)
    Posts: 21846
    Brajesh Singh on #2579

    Looking into it a little bit more and it seems that the pdfmake has issues with plupload js files and that is causing it. I do have a temporary solution for this( we will not load our js files on the avatar upload page, please let me know if that will work for you).

  • Participant
    Level: Initiated
    Posts: 6
    Ross on #2580

    That worked Brajesh…thanks a ton.

  • Keymaster
    (BuddyDev Team)
    Posts: 21846
    Brajesh Singh on #2585

    Hi Ross,
    Thank you. I still believe you should post it to the relevant plugin and let them know that the pdfmake is causing conflict with plupload and that leads to this issue.

    In MediaPress, we do have another solution too. There is a hook that allows avoiding loading any MediaPress js files on certain pages. The following code can be put in the bp-custom.php

    
    //Do not load MediaPress js files on change avatar page
    function mpp_custom_dont_load_js_on_avatar_change( $load ) {
    	
    	if ( bp_is_user_change_avatar() ) {
    		$load = false ;
    	}
    	
    	return $load;
    }
    add_filter( 'mpp_load_js', 'mpp_custom_dont_load_js_on_avatar_change' );
    

    This may also act as a temporary solution.

You must be logged in to reply to this topic.

This topic is: not resolved