cancel
Showing results for 
Search instead for 
Did you mean: 

Facebook integration bug fix for libraries.post.js

jpotts
World-Class Innovator
World-Class Innovator
There's a bug in libraries.post.js. Using the latest build (rev 1374 of community HEAD) if you are looking at a list of documents in someone else's library, you will see a link that says "Back to John Smith's Libraries". If you click on that link you will see John Smith's context but your list of libraries instead of John Smith's libraries.

The bug is fixed by editing libraries.post.js and changing the code to use the argument passed to the web script (which is the FB user ID of the user who's libraries you want to see) instead of the user ID of the currently logged in user.

So change:

  var userFolder = appFolder.childByNamePath("FB" + facebook.user);
  if (userFolder == undefined)
  {
    if (parseInt(facebook.user) != parseInt(url.extension))
    {
      status.code = 500;
      status.message = "User " + url.extension + " does not have a document libraries folder";

To:


  var userLib = url.extension;
  var userFolder = appFolder.childByNamePath("FB" + userLib);
  if (userFolder == undefined)
  {
    if (parseInt(facebook.user) != parseInt(userLib))
    {
      status.code = 500;
      status.message = "User " + userLib + " does not have a document libraries folder";
1 REPLY 1

davidc
Star Contributor
Star Contributor
Thanks for providing the fix.

I had seen that bug, but not the time to diagnose and fix.

I'll check-in to HEAD.