cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to execute script

irene08
Champ in-the-making
Champ in-the-making
Hi! Good Day!

Does anyone knows how to debug this error? Please. Thanks. I got that error in javascript console.

500 Internal Error An error inside the HTTP server which prevented it from fulfilling the request. 09080024 Wrapped Exception (with status template): 09080139 Failed to execute script 'Javascript Console Script': 09080138 TypeError: Cannot read property "1.0" from null (95f636652537d5a2f2efff620411b081.js#16)
___________________________________________________________________________________________________________________
Here is my script.

//Tag category to Approval

    var categoryToAdd = null;
   var categories = classification.getRootCategories("cm:generalclassifiable");
   var remainingNames = ["Document Review Status", "Approval"];
   
   while(categoryToAdd == null && categories && remainingNames.length > 0)
    { 
      var idx = 1, max = categories.length, innerCategories = categories;
     
      // reset categories to prevent further iterations if we don't find a match
      categories = null;
      
      for(;idx < max; idx++)
      {
      var category = categories[idx];
   
          if (wf_actualPercent = 100)
            {
            categories = categories.getSubCategories();
            remainingNames.shift();
            break;
            }
        }
          if(categoryToAdd != null)
            {
         var oldCategories = document.properties["cm:categories"];
         var newCategories = oldCategories != null ? oldCategories : [];
         newCategories.push(categoryToAdd);
         document.properties["cm:categories"] = newCategories;
         document.save();
            }
    }
_______________________________________________________________________________________________________________________

Thank you,
Irene
2 REPLIES 2

ddraper
World-Class Innovator
World-Class Innovator
Hi Irene,

I'm guessing that you're using the latest Community source code as the name of the JavaScript file indicates that you're running with Surf in aggregation mode enabled (assuming that you've specified the whole file name that the JavaScript error is coming from).

To debug the problem I would suggest that you make sure that you're running Share in debug mode (in "share\WEB-INF\classes\alfresco\share-config.xml" you'll find an option for "client-debug" which you can set to "true" which will ensure that your browser does not load the minified JavaScript resources).

Then in your browser you a web inspector tool such as FireBug (in FireFox) or Developer Tools (in Chrome) to place a line break at the line where the error is being thrown from. You can usually get straight to this line from the error message in the JavaScript console. This should be the starting point to determine what's going wrong.

I hope this helps,
Regards,
Dave

irene08
Champ in-the-making
Champ in-the-making
Hi!

Thank you for your reply. I already set the client-debug to true as you said.
If I'm not mistaken, the js#16 is the line that I should debug.

500 Internal Error An error inside the HTTP server which prevented it from fulfilling the request. 09080024 Wrapped Exception (with status template): 09080139 Failed to execute script 'Javascript Console Script': 09080138 TypeError: Cannot read property "1.0" from null (95f636652537d5a2f2efff620411b081.js#16)


Thank you,
Irene