Getting some error when i try to add dashlets

Action → Add Dashlets → Charts (any of them). They will generate some error message, but the charts are working.

Go to Admin, Diagnostics Tool, Output from phpinfo(), look for value of php.ini location.
Go to that php.ini file, edit it to set display_errors = off

Does anyone know the solution for this issue?

I’m not getting that JS error newTop is undefined on Bitnami Suite 7.14.1.

No Warnings printed on the screen because display_errors = off is in the php.ini.
Bitnami Suite 7.14.1 on PHP 8.1.24.

I think this is fix for dashlets in v7.13

Also check your cache folder. I had a Cases dashlet that wasn’t working for me for ages. I tried everything. It seemed to be only a “me” problem and could never figure it out. Then I went in to the cache folder found the dashlets. Deleted from the cache folder and then magically that dashlet started working again. I can’t remember exactly where in the cache folder I found it, but you can try that if all else fails.

(Also you can try all the rebuild JS stuff in repair in rebuild)

Just doing this command from the root of the suite installation is fast way to erase cache after code changes while developing: redacted to prevent damage to production CRM

Hey @chris001 is it a good idea to delete the entire cache? I can’t remember where I read it, but I thought that only some of the cache folder is OK to delete. It may have been from one of @pgr 's blogs or in another thread.

I haven’t noticed any crashes yet after clearing the entire cache dir including all sub dirs and files, while on a development server.
To leave the dir tree untouched, and only remove the files in cache, you can run:
redacted to prevent damage to production CRM while on a dev server.
More here:

1 Like

This is the one I was thinking of…

1 Like

Whoa. This should be added as part of the Admin page. And a command in bin/console. So cache clear gets done safely. Next, those data must be moved out of cache and into a data dir, it’s insane to have valuable data in the same dir as throwaway temp cache files.

2 Likes

From blog:

I’ve been told that you can completely delete the cache directory in the base Sugar directory, but I’ve run into issues with that.

We run the following command while in the cache directory on a Linux system to remove files but leave the folder structure intact.

find -type f -exec rm {} ‘;’

EDIT by moderator: :point_up: be careful not to run the above command except from within the cache directory, as advised. Otherwise, you might destroy your server.

Here is a list of the main directories under the cache directory, with notes against those where you need to be careful. This is for the Community Edition (CE) and is unlikely to be the complete list when you take additional modules you may have installed into account.

Directory Description Deletable?
cache/ The root directory holding cache files and data. No
cache/blowfish/ The encryption keys used to encrypt and decrypt email system passwords.Deleting this will mean the email login passwords can no longer be decrypted, and so the passwords will all need to be entered again. No
cache/csv/ Temporary storage for CSV files that are being exported. Yes
cache/dashlets/ Cache of dashlet PHP scripts, built from source scripts as needed. Yes
cache/diagnostics/ Store for diagnostics when you run SugarCRM’s diagnostics tool. Yes
cache/dynamic_fields/ Cache of custom modules and fields, pulling together many smaller files into larger files for speed.A “Quick Repair and Rebuild” will rebuild this directory. Yes
cache/feeds/ Temporary cache of users’ RSS feeds. Yes
cache/generated_forms/ Where web-to-lead capture forms are stored when they are generated.Whether these can be deleted, depends on whether you use them in-situ, or copy them for use in an external website. Depends
cache/images/ Contains many different types of data. Do not touch. For the Community Edition (CE) this contains images that are temporarily cached before attaching to emails. For the non-CE versions, it contains much more permanent images related to the Knowledge Base. No
cache/import/ Temporary cache area for uploaded CSV files, e.g. lists of contacts or leads. Yes
cache/jsLanguage/ JavaScript versions of the language files, providing localisation for JavaScript functions at the front end. Yes
cache/modules/ Caches code for modules, templates, views, vardefs etc.Most of these files can be deleted, but some of the subdirectories can not. See below for more details. Partially
cache/modules/emails/ Directories for emails stored within SugarCRM.Each directory will link to a user that uses the built-in email capabilities of SugarCRM. No
cache/pdf/ Temporary store for PDFs that are generated for end users. Yes
cache/smarty/ Caches and configuration files for the Smarty templating engine. No
cache/upload/ All uploaded files, e.g. documents uploaded as notes, email attachments, uploaded modules. No
cache/xml/ Temporary files used to create graphs. Yes

Folders that can be deleted (“Yes”) will generally be rebuilt automatically as needed.

@chris001 I have SuiteCRM 7.13 with PHP 7.4

I deleted and rebuild from cache folder too. I still have same error.

When I click on pencil icon of the dashlet, I get below error in the console.

MySugar.js?v=6WY0eIRvQx-xSuYs2iwxMg:49 Uncaught ReferenceError: newTop is not defined
    at Object.fillInConfigureDiv (MySugar.js?v=6WY0eIRvQx-xSuYs2iwxMg:49:481)
    at Object.handleTransactionResponse (sugar_grp1_yui.js?v=6WY0eIRvQx-xSuYs2iwxMg:31:4422)
    at sugar_grp1_yui.js?v=6WY0eIRvQx-xSuYs2iwxMg:31:3935

RELATED PR

You can’t add URL’s to dashlets. This was a security feature added recently. I have a PR on Github to address this and allow for custom entry points. It looks like that’s what you’re trying to do from your screen shot.

You might want to try…Recent Code Addition Causes internal iFrame URL's to stop working · Issue #10150 · salesagility/SuiteCRM · GitHub

Yes, I added those two functions in my code. But it worked for me.