share-extras / js-console

Administration Console component for Alfresco Share, that enables the execution of arbitrary JavaScript code against the repository
Other
74 stars 54 forks source link

logger.warn() and print() not logging to console in Enterprise 5.0.1 (via SDK 2.1). #62

Closed jonsolove closed 8 years ago

jonsolove commented 8 years ago

When I use logger.warn() or print(), which I've used frequently in the past, nothing is written to the "Console output" area. logger.error() prints to the Alfresco logs (per my log4j settings).

This is occurring in Enterprise 5.0.1.

Error from Chrome inspect console:

Uncaught TypeError: Cannot read property 'dumpOutput' of null 14javascript-console_fd1063a2d4a4716d42fde005546e405a.js:1419 Uncaught TypeError: Cannot read property 'dumpOutput' of null ACJC_onExecuteClick.Alfresco.util.Ajax.request.successCallback.fn @ javascript-console_fd1063a2d4a4716d42fde005546e405a.js:1419_successHandlerPostExec @ alfresco_4fa6b0fda69a416a4db5324e6e1f66b3.js:8188_successHandler @ alfresco_4fa6b0fda69a416a4db5324e6e1f66b3.js:8114YAHOO.util.Connect.handleTransactionResponse @ yui-common_728663ab211517e6ebac70f7d93f660f.js:13891(anonymous function) @ yui-common_728663ab211517e6ebac70f7d93f660f.js:13830

ikaygorodov commented 8 years ago

The same occurs for 5.0.2.1 Enterprise.

Error in firefox: TypeError: res.json is null

Error in Chrome: Uncaught TypeError: Cannot read property 'dumpOutput' of null ACJC_onExecuteClick.Alfresco.util.Ajax.request.successCallback.fn @ javascript-console_fd1063a2d4a4716d42fde005546e405a.js:1419 _successHandlerPostExec @ alfresco_a7332e44d471df282bf82de5cb946bb8.js:1 _successHandler @ alfresco_a7332e44d471df282bf82de5cb946bb8.js:1 YAHOO.util.Connect.handleTransactionResponse @ yui-common_0ebd1fff37640abe891d16bbee9d516a.js:17(anonymous function) @ yui-common_0ebd1fff37640abe891d16bbee9d516a.js:17

jonsolove commented 8 years ago

I'm seeing really strange behavior - very occasionally, console output will start working again, then stop. It feels like it may be some sort of js loading order issue, though that's just a guess.

ikaygorodov commented 8 years ago

Actually fix is in this pull request https://github.com/LukaszRacon/js-console/commit/cce6c9e2f862563c947ff4313caa8d02e0404cc1

Just remove row 52 in JavascriptConsoleResult class and everything would be fine =)

jonsolove commented 8 years ago

@ikaygorodov - Great! Thank you! I'll give this a shot locally.

jonsolove commented 8 years ago

Verified - @ikaygorodov's suggestion seems to fix the problem.

jgoldhammer commented 8 years ago

Fixed in master.

Thanks, Jens