AnsweredAssumed Answered

SugarPDF, unexpected redirect to the record page

Question asked by Michele Mazzilli on May 31, 2016
Latest reply on Sep 21, 2017 by Krunoslav Djakovic

Hi all,

we have problems with generating PDF with SugarPDF.

 

Following the instructions here: https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.6/API/Classes/SugarPDF/Generating_PDFs/, we created the file '\custom\modules\myModule\sugarpdf\sugarpdf.document.php', but calling this url:

http://localhost/root/index.php?module=myModule&action=sugarpdf&sugarpdf=document&record=daccabf6-ea7c-f50e-73a2-5725cc4b3a9e

sometimes (not always), instead of seeing the PDF file, SugarCRM redirects us to the record Page (http://localhost/root/#myModule/daccabf6-ea7c-f50e-73a2-5725cc4b3a9e), passing by this url:

http://localhost/root/index.php?action=Login&module=Users&login_module=myModule&login_action=sugarpdf&login_sugarpdf=document&login_record=daccabf6-ea7c-f50e-73a2-5725cc4b3a9e

 

Calling the url with PostMan, the response is:

<script>

if (parent.location == window.location) {

window.location = "http:\/\/localhost\/root\/#myModule\/daccabf6-ea7c-f50e-73a2-5725cc4b3a9e";

} else {

window.top.SUGAR.App.bwc.login("index.php?module=myModule&action=sugarpdf&sugarpdf=document&record=daccabf6-ea7c-f50e-73a2-5725cc4b3a9e");

}

</script>

that seems generated by '\include\MVC\SugarApplication.php', because of problems in LoadUser function (the variable $_SESSION['unique_key'] is empty and $this->controller->allowed_actions is undefined).

 

P.S. : After a QRR (Quick Repair and Rebuild), i always see the PDF correctly.

 

Any idea about this?

 

Version: 7.6 Ent

 

Thanks

Best Regards

Michele

Outcomes