My custom module is breaking the Calendar with "Error while saving"

Hi,

I created a custom module with a manifest and a after_ui_footer logic hook.

Each time I install my module it's working fine, but the calendar is throwing "Error while saving".

I've tried a couple of things but I don't know why I have this message and I need help.

If I remove my module, I don't have the error message. Same with Sugar 6 and 7.

Code of my class and function fired with an after_ui_footer logic hook:

<?php
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class Calendar_style_logic_hook_class
{
  function Calendar_style_logic_hook_method($event, $arguments)
  {
    if (!isset($_REQUEST["to_pdf"]) || $_REQUEST["to_pdf"] == false)
    {
        if($_REQUEST['module'] == 'Calendar')
        {
            echo '<link rel="stylesheet" href="custom/modules/cal.css"/>';
        }
    }
  }
}

Thanks,

Jonathan

  • The Sugar Documentation says for after_ui_footer that "If you are intending to write display logic to the screen, you must first wrap the display logic in an if condition to prevent breaking the Ajax page loads. This logic may vary and it is best to only run your code on specific pages rather than all pages to avoid issues."

    What about the calendar ?

    Jonathan

  • Well it turns out it was a cache issue. It's working fine with Sugar 7.6 and that's what I needed.

    I'm not sure it's working with sugar 6.5 however.

    Jonathan