7.7 Custom entrypoint randomly redirects to index instead of actual entrypoint

I have a custom entrypoint that I installed via the instructions from the 7.7 developer guide.  The entrypoint is a popup window tied to a custom action button in the accounts module.  Below is my JS function that pops up the custom entrypoint.  It will work for a few hours, then it starts popping open the window but redirects to dashboards instead.  At this point it will intermittently work.  Sometimes the correct window opens, most of the time it wont.  A quick repair and rebuild temporarily fixes the issue but then it comes right back an hour or so later.  

order_history_popup: function() {
var account_id = this.model.get('id');
window.open('index.php?entryPoint=orderhistorypopup&account_id='+ account_id, 'Order History', 'width=900,height=680,scrollbars=yes,fullscreen=yes');

}

Parents
  • Thanks Chad and Shad.  I tried both of those things, as well as combining those things together.  Neither of them worked but were great ideas!  

    After banging my head against a wall for a few days now, I actually found out this is a known bug that has yet to be resolved.  A PHPSESSID is not created until you access a BWC module, and if you have not yet accessed a BWC module, you will be redirected.  I could circumvent this by adding /#BWC/index.php?blahblahblah but that means my custom entrypoint would have the Sugar module bar at the top.  

    https://web.sugarcrm.com/support/issues/e64a7da1-1130-ac0c-9824-556c10e9a5d9

  • Ah too bad, good find though.

    I'm not sure if it is related, but the issue seems to be an authentication-related issue. Try putting this at the top of your entry point code:

    global $current_user;
    $current_user = BeanFactory::getBean('Users');
    $current_user->getSystemUser();

    This basically allows the session of the entry point to act as an admin user, so use this with caution. This might be a temporary workaround.

    If the content being displayed needs to adhere to the ACL rights for their sugar user, this wouldn't work because they'll be able to see all records instead of those granted by their user/team/roles.

Reply
  • Ah too bad, good find though.

    I'm not sure if it is related, but the issue seems to be an authentication-related issue. Try putting this at the top of your entry point code:

    global $current_user;
    $current_user = BeanFactory::getBean('Users');
    $current_user->getSystemUser();

    This basically allows the session of the entry point to act as an admin user, so use this with caution. This might be a temporary workaround.

    If the content being displayed needs to adhere to the ACL rights for their sugar user, this wouldn't work because they'll be able to see all records instead of those granted by their user/team/roles.

Children
No Data