Getting some error when i try to add dashlets

Hi Paul

I have found the problem. You will see from the URL that I was using that I included (as I always did previously) the ‘index.php?’ as per the Suitecrm Manual instructions. In this situation it’s probably not important to include this maybe??

It works if I leave out the ‘index.php’ out of the URL.

Maybe to save confusion to others, the line in the function ‘isSelfRequest($endpoint)’ could be altered to;

$entryPointPattern = “/^” . preg_quote($siteUrl, ‘/’) . “/index.php?entryPoint=(” . implode(‘|’, $customEntryPoints) . “)$/i”;

or maybe the code could include both??

I’ll leave it to you to make that change if you wish.

Cheers
Terry

If you check the commit, that’s exactly how its specified.

However, in testing this morning it does not seem to work in7.14.6. I’m trying to get to the bottom of that now.

1 Like

Ok I updated the commit. The issue is if your site URL (in my case) has a trailing slash, the logic is looking for the site URL plus the next slash = // which is incorrect. So I sanitize out first slash if it exists.

Hi Paul

For some reason the links in previous posts never took me to the final commit, only here: Recent Code Addition Causes internal iFrame URL's to stop working · Issue #10150 · salesagility/SuiteCRM · GitHub
so I didn’t see the final commit. I’m not good on GIT

Should never have doubted you :sweat_smile:

Anyway, it looks like we both learned something :thinking:

Cheers

Here is his post


I’ve come accross one other issue with this commit. If the siteURL has a trailing slash it ends up looking for a URL with two trailing slashes. I have to sanitize the URL to deal with a slash at the end of the site URL.

$siteUrl = rtrim($GLOBALS['sugar_config']['site_url'], '/'); // removes trailing slash if present

$entryPointPattern = "/^" . preg_quote($siteUrl, '/') . "\/index.php\?entryPoint=(" . implode('|', $customEntryPoints) . ")(?:&.*)?$/i";