Show Sidebar Log in
Commons In A Box Logo
  • Home
  • About
    • Project Team
    • Logos and Graphics
  • Showcase
    • CBOX Classic Showcase
    • CBOX OpenLab Showcase
  • Demo
  • Get Started
  • Documentation
    • Technical Guide
    • CBOX Classic Guide
    • CBOX OpenLab Guide
  • Support Forums
    • CBOX Classic
    • CBOX OpenLab
    • Developers Forum
  • News

Group Admins

  • Profile picture of Scott Voth

CBOX Classic Support

Public Group active 4 months ago

This group provides support for Commons In A Box Classic, our original software for community-building. Register for an account or log in to commonsinabox.org, then join the group and post your question here.

Problem adding attachments to BP Docs

  • This topic has 3 replies, 4 voices, and was last updated 10 years, 9 months ago by Boone Gorges.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • July 27, 2014 at 11:32 pm #4935
    Daniel Jones
    Participant

    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, 9 months ago by Daniel Jones.
    July 30, 2014 at 9:18 am #4945
    Scott Voth
    Keymaster

    Hi Daniel –

    I think Ray or Boone would be the best ones to answer your question, as they have developed and worked with this plugin extensively.

    Hi @r-a-y  /  @cbox-admin – can one of you help Daniel out?  Thanks.

    July 30, 2014 at 3:11 pm #4947
    Ray
    Keymaster

    I’m not that familiar with BP Docs to be honest. But I’ll try to take a look at this in the upcoming days or so.

    Boone (@cbox_admin) would be a better person to ask.

    July 30, 2014 at 3:22 pm #4948
    Boone Gorges
    Keymaster

    Dan – What version of BuddyPress Docs are you running? Try (manually) updating to 1.8.1. It’s likely that https://github.com/boonebgorges/buddypress-docs/commit/9189226e230308a4ecd25f5c365d8a9bc1d94f1d will fix your issue (you can also try applying it manually).

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In
Group logo of CBOX Classic Support
  • Home
  • Forum
  • Announcements
  • Docs
  • Members 287
  • Send Invites

Groups

Newest | Active | Popular | Alphabetical
  • Group logo of CBOX Classic Support
    CBOX Classic Support
    287 members
  • Group logo of CBOX Pioneers
    CBOX Pioneers
    71 members
  • Group logo of CBOX Developers
    CBOX Developers
    40 members
  • Group logo of CBOX OpenLab Support
    CBOX OpenLab Support
    22 members
  • Group logo of CBOX-OL Testing Partners
    CBOX-OL Testing Partners
    12 members

CBOX has its roots in the CUNY Academic Commons, which in turn was made possible through funding from The City University of New York itself.

CUNY Logo

CUNY Academic Commons Logo

City Tech logo

The Commons In A Box was made possible through the generous support of the Alfred P. Sloan Foundation.

Alfred P. Sloan Foundation Logo

NEH Logo

The CUNY Graduate Center has directly contributed to the CUNY Academic Commons, housing the project since its inception, and has contributed to CBOX through its GC Digital Initiatives.

CUNY Graduate Center Logo

CUNY Graduate Center Digital Initiatives Logo

Powered by Commons In A Box
css.php
Skip to toolbar
  • About WordPress
    • WordPress.org
    • Documentation
    • Learn WordPress
    • Support
    • Feedback
  • Log In
  • Register