mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Recent Code Addition Causes internal iFrame URL's to stop working #5064
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#5064
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pstevens71 on GitHub (Sep 1, 2023).
Issue
I normally create entry points for custom graphs or reports. The entry points are by nature an internal link like:
myurl.com/?entryPoint=myentrypoint
I would use iframe dashlet to insert them on the dashboard. However, (I think in a recent update) this code was added to: /modules/Home/Dashlets/iFrameDashlet/iFrameDashlet.php
if (isSelfRequest($this->url)) { $this->url = ''; }It will always return true if it is an internal URL like an entry point end then set $this->url to blank!
Then the dashlet won't have a URL and won't work. Not sure why this was added or what it's purpose is, but commenting it out seems to fix the issue.
Expected Behavior
create an iframe dashlet
paste in an internal URL (like to an entry point)
And it should render the page inside the dashlet.
Actual Behavior
The url is blanked out by the code listed above and only a message:" Incorrect website location is specified" displays
Possible Fix
Unless there is a good reason for this remove the 3 lines of code.
Steps to Reproduce
Context
I'm trying to embed iFrame of custom entryPoints, which worked previously.
Your Environment
@SuiteBot commented on GitHub (Sep 1, 2023):
This issue has been mentioned on SuiteCRM. There might be relevant details there:
https://community.suitecrm.com/t/how-to-add-other-charts-in-report-charts-for-ex-line-chart-bubble-chart-gauge-chart-funnel-chart-etc/61843/33
@chris001 commented on GitHub (Sep 1, 2023):
If you go to the code and click "

Blame" it tells you when the code was added (7.13.2) and who added, for this one @jack7anderson7 if you look at 7.13.2 release notes or the release tag, it was probably added to fix a particular issue.@pstevens71 commented on GitHub (Sep 1, 2023):
@chris001 cool! Thanks for taking the time to teach me!
@pstevens71 commented on GitHub (Sep 4, 2023):
Ok I think this code was added to prevent malicious code from being inserted in an iframe. I was thinking we could add an exception for custom entry points (I don't really know what the exact security issue was, just guessing, so if it didn't have to do with custom entry points....).
Add a function in /include/utils.php to check for custom entry points like this:
Then we could modify the getCustomEntryPoints() function to return false if the URL matches one of the custom entry point URL's like this:
I've tested the above and it does not allow embedding of internal URL's in iframe (which I think was the intent) and it still allows for the embedding of registered entry points. Hoping @jack7anderson7 will chime in on this one. If it makes sense I'll enter a PR.
@SuiteBot commented on GitHub (Sep 4, 2023):
This issue has been mentioned on SuiteCRM. There might be relevant details there:
https://community.suitecrm.com/t/how-to-add-other-charts-in-report-charts-for-ex-line-chart-bubble-chart-gauge-chart-funnel-chart-etc/61843/39
@SuiteBot commented on GitHub (Sep 20, 2023):
This issue has been mentioned on SuiteCRM. There might be relevant details there:
https://community.suitecrm.com/t/home-page-dashlet-url-not-getting-current-link-suitecrm-8/89755/4
@SuiteBot commented on GitHub (Dec 14, 2023):
This issue has been mentioned on SuiteCRM. There might be relevant details there:
https://community.suitecrm.com/t/third-party-report-writer-compatibility/91230/13
@SuiteBot commented on GitHub (Jan 26, 2024):
This issue has been mentioned on SuiteCRM. There might be relevant details there:
https://community.suitecrm.com/t/entry-points-in-suitecrm-8/91675/2
@chris001 commented on GitHub (Jan 26, 2024):
@pstevens71 Did you make a PR for your solution? If not, you should, it looks good to me.
@shubham-pawar commented on GitHub (Feb 9, 2024):
@chris001, I used code suggested by Paul, but it did not work for me. I am still unable to add web URL dashlets to home page. Could you please provide your code file and steps to implement it? 👍
@chris001 commented on GitHub (Feb 10, 2024):
Hi @shubham-pawar Paul coded functions to allow a dashlet to display a URL which is registered as an "entryPoint" into Suite (internal Suite URL). Paul's code does not allow any external web URL, because those aren't registered as an
entryPointto an internal Suite URL. To allow any external web URL to display in dashlet, you could do it like this, for example: 1) set inconfig_override.phpan array of web URL which you trust & allow to display inside Suite dashlet, 2) check the URL inisSelfRequest($endpoint) : bool, and returntruewhen the URL is matching one of the allowed URL in the array inconfig_override.php.@shubham-pawar commented on GitHub (Feb 14, 2024):
@chris001, I will give it a try some day and update you. Thank you! If you provide code too, it will be helpful.
@shubham-pawar commented on GitHub (Feb 23, 2024):
@chris001
Do you mean something like below in the
config_override.php?$sugar_config['trusted_urls'] = 'https://example.com,https://subdomain.example.com';@chris001 commented on GitHub (Feb 24, 2024):
That could work. In
isSelfRequest()you would check is the URL in the trusted URLs list.@SuiteBot commented on GitHub (Mar 28, 2024):
This issue has been mentioned on SuiteCRM. There might be relevant details there:
https://community.suitecrm.com/t/getting-some-error-when-i-try-to-add-dashlets/91504/16
@SuiteBot commented on GitHub (May 27, 2025):
This issue has been mentioned on SuiteCRM. There might be relevant details there:
https://community.suitecrm.com/t/getting-some-error-when-i-try-to-add-dashlets/91504/24