If you’ve ever developed a SugarCRM Module Package for SugarOnDemand, you’ve probably been confronted with some sort of content restriction. SugarOnDemand currently employs several Module Loader restrictions.
- Package Scan
- File Scan
- Restricted Copy
- Module Loader Actions
- Valid file extension list
- Blacklist functions list
This seems very reasonable, since it is content installed on SugarCRM’s server(s) after all. Unfortunately, these restrictions often limit what a developer can do. For example, many PHP functions are blacklisted by the File Scanner. The valid file extension list restriction will prevent the use of many file types, that may or may not even execute server side.
Here’s an example where the Module Loader restrictions fail to properly examine the package files:
While developing the Google Maps Package for SugarCRM, I ran into many of these restriction challenges. One of the problems I faced was due to the restricted file extensions list. I wanted to integrate DataTables into my Package in order to display an integrated listing view. DataTables is a very easy and quick way to display a table of data thru JavaScript. It comes with an extension called DataTables TableTools that allows for exporting into XLS, CSV, and others. It was the perfect fit for the project. I could integrate it into the maps and allow for both legend and selection based filtering.
DataTables – TableTools
http://datatables.net/extras/tabletools/
Unfortunately, the file extension type restrictions list flagged the Flash files (.swf) and prevented the content from installing. Luckily, I found a very simple way around this. The solution was to use a JavaScript CDN. I found DataTables and the complete DataTables TableTools extension on cdnjs.com. This included the JavaScript (.js), images (.png) and Flash files (.swf). cdnjs.com is quickly becoming one of my favorite CDNs.
cdnjs – TableTools
http://cdnjs.com/libraries/datatables-tabletools/
By using a JavaScript CDN, all of the restricted files of the DataTables – TableTools Extension were loaded from the CDN and therefor they did not have to be included in the SugarCRM Module Package. The problem was solved and many people were happy to see the advanced listing and exporting functionality. I expect that the use of a JavaScript CDN to avoid Module Loader restrictions will become much more common. Feel free to comment on how you’ve avoided the Module Loader restrictions of SugarCRM and/or SugarOnDemand.