I’m not exactly looking for a solution to this problem, but some pointing in the right direction would be really helpful.
Recently (I’m not actually 100% sure if this started happening right after an update to CBOX and BP Docs or after some other change) I haven’t been able to add attachments to Docs. The attachments that I’ve already uploaded still show up like they used to, but the Add File button doesn’t work anymore, and produces the following errors in javascript – “Uncaught ReferenceError: bp_docs is not defined” and “Uncaught TypeError: Cannot read property ‘frame’ of undefined” from the following functions respectively from attachments.js in the BP Docs plugin:
$(document).ready(function(){
file_frame = new BP_Docs_MediaFrame({
title: bp_docs.upload_title, // this is the line that produces the error
button: {
text: bp_docs.upload_button,
text: bp_docs_attachments.upload_button
},
multiple: false
});
Library = file_frame.states.get('library');
});
$('.add-attachment').on('click', function( event ){
event.preventDefault();
// Change to upload mode
Library.frame.content.mode('upload'); // this is the line that produces the error
// Open the dialog
file_frame.open();
return;
});
It makes sense that if bp_docs is undefined that file_frame wouldn’t get defined and so Library would never get defined and clicking the Add File button would produce an error. My question is where is bp_docs defined in javascript for the BP Docs plugin? I looked around in the other js files in the plugin and couldn’t find it. I see that it’s referenced in bp-docs.js but not defined anywhere there. What would make bp_docs cause a javascript uncaught reference error in attachments.js? Any help would be greatly appreciated.
Thanks!
Dan
-
This topic was modified 10 years, 5 months ago by Daniel Jones.