Email templates not loading

Need Help.

I upgraded to 7.11.4 and now email templates are not loading when I am composing an email. The email template search box pops up but when I click on a template it doesn’t pull into the compose email window? Otherwise email work fine, can compose and send.

Suitecrm 7.11.4
PHP 7.2
MariaDB

Already checked permissions which are fine. Ran repair, rebuild javascript language. Tried different browsers. Following is error recent log:

Thu May 16 13:06:34 2019 [1760301][1][FATAL] Mysqli_query failed.
Thu May 16 13:06:34 2019 [1760301][1][FATAL] Query Failed: select * from WHERE id=‘null’ and deleted=0: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE id=‘null’ and deleted=0’ at line 1
Thu May 16 13:06:35 2019 [1760301][1][FATAL] MysqliManager: Empty query
Thu May 16 13:35:09 2019 [1812986][1][FATAL] Mysqli_query failed.
Thu May 16 13:35:09 2019 [1812986][1][FATAL] Query Failed: select * from WHERE id=‘null’ and deleted=0: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE id=‘null’ and deleted=0’ at line 1
Thu May 16 13:35:09 2019 [1812987][1][FATAL] Mysqli_query failed.
Thu May 16 13:35:09 2019 [1812987][1][FATAL] Query Failed: select * from WHERE id=‘null’ and deleted=0: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE id=‘null’ and deleted=0’ at line 1
Fri May 17 07:11:40 2019 [3677475][1][FATAL] Exception handling in /home/assuredf/public_html/crm/include/MVC/Controller/SugarController.php:400
Fri May 17 07:11:40 2019 [3677475][1][FATAL] Exception in Controller: Failed to parse Host URL ‘http://’
Fri May 17 07:11:40 2019 [3677475][1][FATAL] backtrace:
#0 /home/assuredf/public_html/crm/lib/Search/ElasticSearch/ElasticSearchClientBuilder.php(177): SuiteCRM\Search\ElasticSearch\ElasticSearchClientBuilder::sanitizeHost(Array)
#1 /home/assuredf/public_html/crm/lib/Search/ElasticSearch/ElasticSearchClientBuilder.php(63): SuiteCRM\Search\ElasticSearch\ElasticSearchClientBuilder::loadFromSugarConfig()
#2 /home/assuredf/public_html/crm/lib/Search/ElasticSearch/ElasticSearchIndexer.php(86): SuiteCRM\Search\ElasticSearch\ElasticSearchClientBuilder::getClient()
#3 /home/assuredf/public_html/crm/lib/Search/ElasticSearch/ElasticSearchIndexer.php(576): SuiteCRM\Search\ElasticSearch\ElasticSearchIndexer->__construct()
#4 /home/assuredf/public_html/crm/modules/Administration/repairDatabase.php(179): SuiteCRM\Search\ElasticSearch\ElasticSearchIndexer::repairElasticsearchIndex()
#5 /home/assuredf/public_html/crm/modules/Administration/QuickRepairAndRebuild.php(142): include_once(’/home/assuredf/…’)
#6 /home/assuredf/public_html/crm/modules/Administration/QuickRepairAndRebuild.php(124): RepairAndClear->repairDatabase()
#7 /home/assuredf/public_html/crm/modules/Administration/views/view.repair.php(61): RepairAndClear->repairAndClearAll(Array, Array, false, true)
#8 /home/assuredf/public_html/crm/include/MVC/View/SugarView.php(226): ViewRepair->display()
#9 /home/assuredf/public_html/crm/include/MVC/Controller/SugarController.php(435): SugarView->process()
#10 /home/assuredf/public_html/crm/include/MVC/Controller/SugarController.php(375): SugarController->processView()
#11 /home/assuredf/public_html/crm/include/MVC/SugarApplication.php(113): SugarController->execute()
#12 /home/assuredf/public_html/crm/index.php(52): SugarApplication->execute()
#13 {main}

Any suugestions?

Thanks
ES

Maybe you can try to get your elasticSearch configuration correct so this error doesn’t occur. It might be breaking other things in the app.

Check your host URL for Elastic and the rest of the installation instructions:

https://docs.suitecrm.com/admin/administration-panel/search/elasticsearch/

The thing is we never configured or touched Elasticsearch since upgrading to 7.11 - it’s still set to Basic+Advance so I don’t know why Elasticsearch errors are show up? I know that the templates where working fine when it was 7.10.15 but now after upgrading it doesn’t. Composing and sending emails does.

ES

Hi,
i also have the same problem, mine is a new installation, among other things I also tested suitecrm demo and there is the same problem.
Thanks in advance for the help

Suitecrm 7.11.4
PHP 7.2
Mysql

I think this is a problem with 7.11.4 as I have seen others recently posted same problem.

Ed

I can’t reproduce on my installation.

Can somebody please provide exact steps? I would like to try on the same module where you are, coming from the same screen, pressing the same button etc.

Steps:

  1. Click on Leads or Contacts
  2. Click on email address in list view (have also tried in detail view)
  3. Compose email pops up
  4. Click Templates
  5. Select a email template
  6. Goes back to Compose Email but Template doesn’t fill in - nothing happens

I have tried on IE, Edge and Chrome without luck.

Ed

Sorry, works for me :huh:

The only thing strange that I see is that when I click the email address, I get two “compose” windows: one within SuiteCRM, and another that Windows opens on the Desktop with my default email client (Thunderbird).

Do you see any Javascript errors in your browser’s Developer console?

Ok, checked browser for any errors and did get this:

Line 50
Object Missing

and then this is the code - line 50 is the after the result data line.


else{fill_array_contents(the_key,field_to_name_array[the_key]);}}}
var popupConfirm=confirmDialog(array_contents,form_name);var name_to_value_array=JSON.parse('{'+array_contents.join(",")+'}')
closePopup();var result_data={"form_name":form_name,"name_to_value_array":name_to_value_array,"passthru_data":passthru_data,"popupConfirm":popupConfirm};call_back_function(result_data);}
function send_back_teams(module,form,field,error_message,request_data,form_team_id){var array_contents=Array();if(form_team_id){array_contents.push(form_team_id);}else{var j=0;for(i=0;i<form.elements.length;i++){if(form.elements[i].name==field){if(form.elements[i].checked==true){array_contents.push(form.elements[i].value);}}}}
if(array_contents.length==0){window.alert(error_message);return;}

I think it has something to do with this since this is the code for the templates and reference popup and data passthru.

ES

I just registered and tried doing this with suitecrm demo which is running 7.11.4 and it’s also doing the same thing not pulling the email template when composing an email.

So I thinks this is a 7.11.4 issue since it’s happening on your environment and with your online demo.

ES

Any suggestions?

ES

Further diagnosing and setup a new fresh install of suitecrm and email templates still not working.

ES

Maybe there is some difference in the way your Accounts are set up. Please make sure you fill all fields (reply-to, from-name, etc).

I checked but this isn’t working on suitecrm online demo and the new test install I did which would be default setup with no changes? Have you looked at the suitecrm online demo?

ES

I assume it is not working on the online demo, because you said so - I don’t need to go and check because I believe you :slight_smile:

But since it is working in my installation, I was wondering if it could be related to the way the email account is configured. For example, on the live demo you can’t configure an account, can you?

This is why I made my request above for you to try adding every field in the configuration.

Hi SuiteCRM.

Email Templates do not work for us on Version 7.10.16

  1. Click on Contacts --> Click on Contact’s Email Address.
  2. Click on Template Search arrow button
  3. Click the search Search Template button
  4. Click any template.

What should happen is: my email body should be replaced with the new body of the template.

What does happen is: Nothing - No javascript errors nor any errors in the php log or suitecrm log that I can find.

— Another way to reproduce:

  1. Click on Emails
  2. click Compose
  3. Click Search template button
  4. Click Search button in the pop-up search.
  5. Click any template

What should happen is: my email body should be replaced with the new body/subject of the template.
What does happen is: Nothing. Again, no javascript errors nor any server log errors.

Just thought I’d share since this is a different version having similar issues as the poster here.

1 Like

Hello,
I did various tests, even with the demo version, creating an email account but with the same problem. I also tried the 7.10.16 LTS version even with this one I can’t use the template.
Seems really weird, do you think it could be some package PHP missing?

You can try running

composer install

on your SuiteCRM directory to update the 3rd party packages. but this shouldn’t be necessary, they come in our own upgrade packages.

I tried running composer install, it gave me an error because vendor/browserstack/browserstack-local doesn’t exist. I ran composer install --no-dev and running that didn’t seem to fix the email template issue.

Sorry,

composer install --no-dev

… was in fact the correct thing to try, my mistake.

If that didn’t help I think you might be getting this bug (which already has a proposed fix):

https://github.com/salesagility/SuiteCRM/issues/7271

1 Like