PDF Template Suddenly Blank in Edit Mode

I had created many pdf templates and was able to go back in and edit them. Suddenly now when I try to edit any of my pdf templates, I get a blank screen. I did notice that the URL ( http://roofdini.biscayneroofing.com/index.php) looks a bit naked in comparison with the detail view of the PDF templates, which is (http://roofdini.biscayneroofing.com/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DAOS_PDF_Templates%26offset%3D1%26stamp%3D1542316429043871300%26return_module%3DAOS_PDF_Templates%26action%3DDetailView%26record%3D6d402eac-a9b6-0186-33e4-5be07255d877). I have tried quick repair several times.

I am running SuiteCRM v 7.10.7. I tried to add image files using the link provided here but didn’t seem to work.

Thanks

In list view (where you see all your PDF templates) mouse over the pencil icon. At the bottom of your browser, you will see a link where that leads. Take a screenshot of that and post it back here. (Alt+Print Screen on your keyboard)

You can edit it down, if you like, all we want to see is the URL it is pointing to.

When you say ‘suddenly’ do you mean 5 minutes ago you could edit pdfs and 5 minutes later, now you can’t? Or did more time pass where things could’ve been changed in the database or code?

If the latter, do you have any idea what you have been working on in the database or code?

Thank you for your response. There was time between the time I could last edit a pdf template and when I suddenly couldn’t. There are 2 of us working on the CRM and it had been days since I had last been able to edit a template. There have been many changes to a lot of the custom modules we’ve created (in code) as well as in the CRM studio.

I keep trying to click the Add File button and it does nothing for me except show the allowed file extensions on hover. I’m not seeing any other way to add an image than to use a link to my google drive. Please let me know if there’s a better way.

Thank you.

I also looked in the developer console and there is an failure to load a resource: glyphicons-halflings-regular.woff2. I checked and the font is in the directory.
The log files didn’t seem to tell “me” much. I’ve added the links for them below.

RoofDini.log drive.google.com/open?id=1Htgg2hgrJNyALFRIHEqARfj3fA_XemSJ

PHP Error Log drive.google.com/open?id=1Knuhl2C2rW4ZEeBZOWfY4CBKRAy-2sxl

When I try to created a pdf template and get the pop up error window (mentioned above), I take a look at the php error log and am getting this. The issued_c reference was a field that was created in studio and has since been removed. However, I believe that field was referenced on one of the pdf templates. I went through all the code looking for that reference and it only appeared in the custom\history\modules folders. I commented out those references, ran quick repair and still no change. Maybe there’s something else you may see here.

[16-Nov-2018 16:49:01 Europe/Dublin] PHP Warning: fopen(./roofdini.log): failed to open stream: Resource temporarily unavailable in C:\inetpub\wwwroot\include\SugarLogger\SugarLogger.php on line 210
[16-Nov-2018 16:49:01 Europe/Dublin] PHP Warning: fwrite() expects parameter 1 to be resource, boolean given in C:\inetpub\wwwroot\include\SugarLogger\SugarLogger.php on line 228
[16-Nov-2018 16:49:04 Europe/Dublin] PHP Notice: Undefined index: K11_AOS_Work_Orders in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php on line 102
[16-Nov-2018 16:49:04 Europe/Dublin] PHP Fatal error: Uncaught Error: Class name must be a valid object or a string in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php:103
Stack trace:
#0 C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php(27): AOS_PDF_TemplatesViewEdit->setFields()
#1 C:\inetpub\wwwroot\include\MVC\View\SugarView.php(207): AOS_PDF_TemplatesViewEdit->display()
#2 C:\inetpub\wwwroot\include\MVC\Controller\SugarController.php(432): SugarView->process()
#3 C:\inetpub\wwwroot\include\MVC\Controller\SugarController.php(375): SugarController->processView()
#4 C:\inetpub\wwwroot\include\MVC\SugarApplication.php(109): SugarController->execute()
#5 C:\inetpub\wwwroot\index.php(52): SugarApplication->execute()
#6 {main}
thrown in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php on line 103
[16-Nov-2018 16:49:21 Europe/Dublin] PHP Warning: include(C:\inetpub\wwwroot\cache\modules\Employees\Employeevardefs.php): failed to open stream: Resource temporarily unavailable in C:\inetpub\wwwroot\include\SugarObjects\VardefManager.php on line 174
[16-Nov-2018 16:49:21 Europe/Dublin] PHP Warning: include(): Failed opening ‘cache/modules/Employees/Employeevardefs.php’ for inclusion (include_path=‘C:\inetpub\wwwroot\include/…;.;C:\php\pear’) in C:\inetpub\wwwroot\include\SugarObjects\VardefManager.php on line 174
[16-Nov-2018 16:49:21 Europe/Dublin] PHP Warning: include(C:\inetpub\wwwroot\cache\modules\Users\Uservardefs.php): failed to open stream: Resource temporarily unavailable in C:\inetpub\wwwroot\include\SugarObjects\VardefManager.php on line 174
[16-Nov-2018 16:49:21 Europe/Dublin] PHP Warning: include(): Failed opening ‘cache/modules/Users/Uservardefs.php’ for inclusion (include_path=‘C:\inetpub\wwwroot\include/…;.;C:\php\pear’) in C:\inetpub\wwwroot\include\SugarObjects\VardefManager.php on line 174
[16-Nov-2018 16:49:21 Europe/Dublin] PHP Warning: sugar_file_put_contents_atomic() : fatal rename failure ‘C:\inetpub\wwwroot\cache\modules\EmailAddresses\tem219E.tmp’ -> ‘cache/modules/EmailAddresses/EmailAddressvardefs.php’ in C:\inetpub\wwwroot\include\utils\sugar_file_utils.php on line 199
[16-Nov-2018 16:49:22 Europe/Dublin] PHP Notice: Undefined index: issued_c in C:\inetpub\wwwroot\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 16:49:22 Europe/Dublin] PHP Notice: Undefined index: width in C:\inetpub\wwwroot\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 16:49:22 Europe/Dublin] PHP Notice: Undefined index: width in C:\inetpub\wwwroot\include\ListView\ListViewSmarty.php on line 139

Thanks.

To add to above…
Since I commented out the issue_c references in code and I have also deleted templates I created in the database that I thought might be the culprit and when I try to edit a template, I get this in the php error log:

[16-Nov-2018 16:56:05 Europe/Dublin] PHP Notice: Undefined index: issued_c in C:\inetpub\wwwroot\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 16:56:05 Europe/Dublin] PHP Notice: Undefined index: width in C:\inetpub\wwwroot\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 16:56:05 Europe/Dublin] PHP Notice: Undefined index: width in C:\inetpub\wwwroot\include\ListView\ListViewSmarty.php on line 139
[16-Nov-2018 16:56:08 Europe/Dublin] PHP Notice: Undefined index: K11_AOS_Work_Orders in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php on line 102
[16-Nov-2018 16:56:08 Europe/Dublin] PHP Fatal error: Uncaught Error: Class name must be a valid object or a string in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php:103
Stack trace:
#0 C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php(27): AOS_PDF_TemplatesViewEdit->setFields()
#1 C:\inetpub\wwwroot\include\MVC\View\SugarView.php(207): AOS_PDF_TemplatesViewEdit->display()
#2 C:\inetpub\wwwroot\include\MVC\Controller\SugarController.php(432): SugarView->process()
#3 C:\inetpub\wwwroot\include\MVC\Controller\SugarController.php(375): SugarController->processView()
#4 C:\inetpub\wwwroot\include\MVC\SugarApplication.php(109): SugarController->execute()
#5 C:\inetpub\wwwroot\index.php(52): SugarApplication->execute()
#6 {main}
thrown in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php on line 103
[16-Nov-2018 16:56:35 Europe/Dublin] PHP Warning: include(C:\inetpub\wwwroot\cache\modules\Users\Uservardefs.php): failed to open stream: Resource temporarily unavailable in C:\inetpub\wwwroot\include\SugarObjects\VardefManager.php on line 174
[16-Nov-2018 16:56:35 Europe/Dublin] PHP Warning: include(): Failed opening ‘cache/modules/Users/Uservardefs.php’ for inclusion (include_path=‘C:\inetpub\wwwroot\include/…;.;C:\php\pear’) in C:\inetpub\wwwroot\include\SugarObjects\VardefManager.php on line 174
[16-Nov-2018 16:56:35 Europe/Dublin] PHP Notice: Undefined index: issued_c in C:\inetpub\wwwroot\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 16:56:35 Europe/Dublin] PHP Notice: Undefined index: width in C:\inetpub\wwwroot\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 16:56:35 Europe/Dublin] PHP Notice: Undefined index: width in C:\inetpub\wwwroot\include\ListView\ListViewSmarty.php on line 139

I’m not sure I’m going to be much help on this one. It might be worth reviewing if there is anything noteworthy in the logs after doing a quick repair and rebuild (or in the output it puts the screen when doing a quick repair and rebuild.

It seems possible to me something isn’t getting built properly… based on the errors thinking there should still be an issued_c, which has been deleted.

Oh, and it doens’t seem like I can add a file in this forum either… so you’re not alone. I’m using Chrome, no idea if that is the problem.

I’m assuming you’ve reviewed C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php on line 103 to see what is there?

sieberta

@Michelle what is your PHP version?

I agree with @sieberta that you should focus on that FATAL message.

Does your line 103 in that file look like this?

You can add screenshots at https://pasteboard.co

PHP v 7.2.
I did look at line 103 in that file and looks the same as the one you posted. Nothing informative on the quick repair screen…just standard messages. I’m looking at the fatal error now.

I’m actually getting a different fatal error since I commented out the issue_c reference in the custom\history files.

FATAL ERROR:
[16-Nov-2018 18:10:04 Europe/Dublin] PHP Fatal error: Uncaught Error: Class name must be a valid object or a string in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php:103

When I click the create pdf template button now, I get.

[16-Nov-2018 18:10:01 Europe/Dublin] PHP Notice:  Undefined index: billing_address_street in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 18:10:01 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 18:10:01 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 139
[16-Nov-2018 18:10:03 Europe/Dublin] PHP Notice:  Undefined index: billing_address_street in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 18:10:04 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 18:10:04 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 139
[16-Nov-2018 18:10:04 Europe/Dublin] PHP Notice:  Undefined index: billing_address_street in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 18:10:04 Europe/Dublin] PHP Notice:  Undefined index: K11_AOS_Work_Orders in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php on line 102
[16-Nov-2018 18:10:04 Europe/Dublin] PHP Fatal error:  Uncaught Error: Class name must be a valid object or a string in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php:103
Stack trace:
#0 C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php(27): AOS_PDF_TemplatesViewEdit->setFields()
#1 C:\inetpub\wwwroot\include\MVC\View\SugarView.php(207): AOS_PDF_TemplatesViewEdit->display()
#2 C:\inetpub\wwwroot\include\MVC\Controller\SugarController.php(432): SugarView->process()
#3 C:\inetpub\wwwroot\include\MVC\Controller\SugarController.php(375): SugarController->processView()
#4 C:\inetpub\wwwroot\include\MVC\SugarApplication.php(109): SugarController->execute()
#5 C:\inetpub\wwwroot\index.php(52): SugarApplication->execute()
#6 {main}
  thrown in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php on line 103
[16-Nov-2018 18:10:05 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 18:10:05 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 139
[16-Nov-2018 18:10:06 Europe/Dublin] PHP Notice:  Undefined index: billing_address_street in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 18:10:06 Europe/Dublin] PHP Notice:  Undefined index: billing_address_street in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 18:10:06 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 18:10:06 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 139
[16-Nov-2018 18:10:06 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 18:10:06 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 139
[16-Nov-2018 18:10:07 Europe/Dublin] PHP Notice:  Undefined index: issued_c in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 18:10:07 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 18:10:07 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 139
[16-Nov-2018 18:10:11 Europe/Dublin] PHP Notice:  Undefined index: billing_address_street in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 18:10:11 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 18:10:11 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 139
[16-Nov-2018 18:10:19 Europe/Dublin] PHP Notice:  Undefined index: K11_AOS_Work_Orders in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php on line 102
[16-Nov-2018 18:10:19 Europe/Dublin] PHP Fatal error:  Uncaught Error: Class name must be a valid object or a string in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php:103
Stack trace:
#0 C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php(27): AOS_PDF_TemplatesViewEdit->setFields()
#1 C:\inetpub\wwwroot\include\MVC\View\SugarView.php(207): AOS_PDF_TemplatesViewEdit->display()
#2 C:\inetpub\wwwroot\include\MVC\Controller\SugarController.php(432): SugarView->process()
#3 C:\inetpub\wwwroot\include\MVC\Controller\SugarController.php(375): SugarController->processView()
#4 C:\inetpub\wwwroot\include\MVC\SugarApplication.php(109): SugarController->execute()
#5 C:\inetpub\wwwroot\index.php(52): SugarApplication->execute()
#6 {main}
  thrown in C:\inetpub\wwwroot\modules\AOS_PDF_Templates\views\view.edit.php on line 103
[16-Nov-2018 18:10:24 Europe/Dublin] PHP Notice:  Undefined index: issued_c in C:\inetpub\wwwroot\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 18:10:24 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\wwwroot\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 18:10:24 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\wwwroot\include\ListView\ListViewSmarty.php on line 139
[16-Nov-2018 18:10:28 Europe/Dublin] PHP Notice:  Undefined index: issued_c in C:\inetpub\wwwroot\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 18:10:28 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\wwwroot\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 18:10:28 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\wwwroot\include\ListView\ListViewSmarty.php on line 139
[16-Nov-2018 18:10:28 Europe/Dublin] PHP Notice:  Undefined index: issued_c in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\Dashlets\DashletGeneric.php on line 400
[16-Nov-2018 18:10:28 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 133
[16-Nov-2018 18:10:28 Europe/Dublin] PHP Notice:  Undefined index: width in C:\inetpub\Dev\roofdini.biscayneroofing.com\include\ListView\ListViewSmarty.php on line 139

I’ve done a find in project for the issue_c culprit but get no results. Not sure why it’s still causing a problem or where else I could look for it. Also checked in the DB and there’s no visible reference.

When you’re doing a “find in project” are you doing that on a development machine or on the actual server? The reason I ask is, when you do a quick rebuild and repair, it creates a bunch of files from your source files that are the actual executed code… so if you run this on your development machine, you may not be searching the files that are actually parsed on the server. (at least this is my understanding of how SuiteCRM & Quick Repair & Rebuild works)

That is why I asked if you got an errors on a rebuild and repair, because I wondered if one or more of those files were not getting rebuilt correctly, thereby leaving behind the issued_c reference.

sieberta

In version Version 7.11.13
Sugar Version 6.5.25 (Build 344)
on ubuntu i made the following changes to fix the blank screen.
I commented out the following code line from
@mb_regex_encoding(‘UTF-8’);
from the file
modules/AOS_PDF_Templates/PDF_lib/mpdf.php

@nitishpandey

We can’t change that line in core, though, because it belongs in a 3rd-party library. So the definitive fix would have to be before that, in one of the functions that call it.

Do you have any ideas? Why is encoding an issue here, is it the module name that has some special characters?

Thanks for your help

I see.
I tried to capture exception but could not. It just stops without a log entry as well.
It dies on function call with a single string argument. Therefore it doesn’t seem to be related to module name.
Could be that the library function is not installed on my system? I don’t know. How do i check that?

That would be the mbstring library which is definitely required for SuiteCRM. Check Admin / Diagnostics / phpinfo if it is loaded or not.

i do have this: Multibyte String Functions Tsukada Takuya, Rui Hirokawa

i checked funcion_exists. Nope it doesn’t

Well, check online how to install mbstring for your PH version and your OS.

You might also have it installed, but it might be disabled in php.ini. However on Ubuntu I find all I need to do is the apt install php-mbstring php7.3-mbstring and it takes care of everything.

Remember to restart web server.

This worked for me.
I uncommented that function call and still everything is working fine.
Yes i did restart the server.

apt install php-mbstring
Only, thing PHP module should log or throw an exception when it comes across an undefined library function.

In your php.ini, you’ll find an entry called error_log which defines a log file. Don’t you see a message in that file when the function is not found?