Answers.Body: <p>This seems to be fixed in 5.6.0. If you have to upgrade to 5.5.1 or have problems so need to do it incrementally, at the suggestion of Aidan@Squiffle commenting out the <code>UPDATE civicrm_msg_template SET msg_{$template['type']}</code> command at the bottom of CiviCRM/CRM/Upgrade/Incremental/MessageTemplates.php seemed to work.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-28T14:33:31.310Z
Answers.Text: Thank you very much ! I managed upgrading by commenting the recommended lines in CiviCRM/CRM/Upgrade/Incremental/MessageTemplates.php
Answers.UserDisplayName: ITSupport ERELOS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-28T15:55:40.850Z
Answers.Text: Following the upgrade to 5.4.1, I upgraded to 5.8.2 but got the same issue than before -> so doesn't seem to be fixed by 5.6. I had to comment the same lines in  MessageTemplates.php and the upgrade successfully moved forward.
Answers.UserDisplayName: ITSupport ERELOS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-29T13:28:04.857Z
Answers.Text: Glad it's now working. To dble check, are you saying that having fixed it for 5.4.1 to 5.6.0, you then had to correct it again when you upgraded to 5.8.2? Or just when you went 5.4.1 to 5.8.2?
Answers.UserDisplayName: Nic
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-30T17:18:34.747Z
Answers.Text: I went directly to 5.8.2 from 5.4.1 :( did get the opportunity to check with 5.6 - Thanks again !
Answers.UserDisplayName: ITSupport ERELOS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-10T15:04:46.970Z
Answers.LastActivityDate: 2018-10-10T15:04:46.970Z
Answers.UserDisplayName: Nic
Answers.Body: <p>I'm sorry not to post in the comments but I do not have 50 points yet.</p>
  
  <p>@Nic , can you explain your answer better? from version 5.4 exists the file MessageTemplates.php but (in WordPress) however does not update from 5.3.2 to 5.4</p>
  
  <p>@Tellie , did you solve the problem?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-29T22:15:04.693Z
Answers.Text: Just seen this - sorry for the delay. If you've not fixed it yet - do you have the same problem upgrading to 5.6 or 5.7? If so then maybe commenting out that command should help? I've not tried on WP tho, sorry, just Joomla.
Answers.UserDisplayName: Nic
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-02T11:42:29.920Z
Answers.LastActivityDate: 2018-11-02T11:42:29.920Z
Answers.UserDisplayName: Alessandro Letizia
Answers.Body: <p>Have you ever found an fix for this issue? I got the exact same problem when upgrading from 5.3.2 to 5.6.0 or for that case any higher version then 5.3.2. I think it's a bug in the upgrader because I checked the civicrm_msg_template table to the original SQL schema and there are no differences.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-05T00:04:39.537Z
Answers.Text: Hi Tallie,Comments should be used if what you are posting is not an answer to the question being asked. You might want to delete your answer and post it as a comment to avoid down votes.
Answers.UserDisplayName: Tamar Meir - Cividesk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-09T07:23:32.273Z
Answers.Text: If StackExchange would allow me to, I get the notification 'You must have 50 reputation to comment'....
Answers.UserDisplayName: Tallie
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-03T22:51:20.817Z
Answers.LastActivityDate: 2018-10-03T22:51:20.817Z
Answers.UserDisplayName: Tallie
Answers.Body: <p>I guess your system has either missing 'Event Online Receipt' message template or the template is not reserved. Check by running below query if it returns result.</p>
  
  <pre><code>SELECT id FROM civicrm_msg_template WHERE workflow_id IN (SELECT MAX(id) as id FROM civicrm_option_value WHERE name = 'event_online_receipt') AND is_reserved = 1
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-31T13:10:03.337Z
Answers.Text: Indeed no result return, how should i fix that ? Thanks !
Answers.UserDisplayName: ITSupport ERELOS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-31T13:44:29.973Z
Answers.Text: This is one also return no result : SELECT id FROM civicrm_msg_template WHERE workflow_id IN (SELECT MAX(id) as id FROM civicrm_option_value WHERE name = 'event_offline_receipt') AND is_reserved = 1 ;(event_offline_receipt)
Answers.UserDisplayName: ITSupport ERELOS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-31T13:47:06.443Z
Answers.Text: Can you try running the query by running without is_reserved = 1
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-31T15:39:12.750Z
Answers.Text: SELECT id FROM civicrm_msg_template WHERE workflow_id IN (SELECT MAX(id) as id FROM civicrm_option_value WHERE name = 'event_online_receipt'); no result
Answers.UserDisplayName: ITSupport ERELOS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-31T15:39:34.550Z
Answers.Text: SELECT id FROM civicrm_msg_template WHERE workflow_id IN (SELECT MAX(id) as id FROM civicrm_option_value WHERE name = 'event_offline_receipt'); no result
Answers.UserDisplayName: ITSupport ERELOS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-31T16:09:11.183Z
Answers.Text: Can you check Message template if you can see Event Online and Offline templates?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-31T16:49:08.000Z
Answers.Text: Can you check through CiviCRM UI
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-02T08:45:58.620Z
Answers.Text: Please see issue description for screenshots, UI (in French) & DB (msg_template) and (option_value). Do you see something wrong ? How can we move forward ? Thanks for your help
Answers.UserDisplayName: ITSupport ERELOS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-04T15:23:09.773Z
Answers.Text: do you have any additional guidelines that may help us to troubleshoot ? thank you very much.
Answers.UserDisplayName: ITSupport ERELOS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-24T11:55:24.263Z
Answers.Text: @pradpnayak hello, do you have any advice to get this issue solved ? thanks in advance
Answers.UserDisplayName: ITSupport ERELOS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-24T12:00:17.120Z
Answers.Text: its difficult to predict query unless i can look into the db entries. And i don't want to provide queries that would affect your whole database.
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-31T12:54:05.997Z
Answers.LastActivityDate: 2018-08-31T12:54:05.997Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>Context : Wordpress  4.9.8–fr_FR, PHP version 7.0.22, libmysql - mysqlnd 5.0</p>
  
  <p>Hello
  When trying to run the upgrade script from 5.0.1 to 5.4.1, I got this issue : </p>
  
  <pre><code>    Aug 31 13:51:25  [info] $Fatal Error Details = Array
  (
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; handle
          )
  
      [code] =&gt; -2
      [message] =&gt; DB Error: syntax error
      [mode] =&gt; 16
      [debug_info] =&gt; 
          UPDATE civicrm_msg_template SET msg_text = '{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $receipt_text}\n{$receipt_text}\n{/if}\n{if $is_pay_later}\n\n===========================================================\n{$pay_later_receipt}\n===========================================================\n{else}\n\n{ts}Please print this receipt for your records.{/ts}\n{/if}\n\n{if $membership_assign &amp;&amp; !$useForMember}\n===========================================================\n{ts}Membership Information{/ts}\n\n===========================================================\n{ts}Membership Type{/ts}: {$membership_name}\n{if $mem_start_date}{ts}Membership Start Date{/ts}: {$mem_start_date|crmDate}\n{/if}\n{if $mem_end_date}{ts}Membership End Date{/ts}: {$mem_end_date|crmDate}\n{/if}\n\n{/if}\n{if $amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{if !$useForMember &amp;&amp; $membership_amount &amp;&amp; $is_quick_config}\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{if $amount &amp;&amp; !$is_separate_payment }\n{ts}Contribution Amount{/ts}: {$amount|crmMoney}\n-------------------------------------------\n{ts}Total{/ts}: {$amount+$membership_amount|crmMoney}\n{/if}\n{elseif !$useForMember &amp;&amp; $lineItem and $priceSetID &amp; !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n---------------------------------------------------------\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"}\n----------------------------------------------------------\n{foreach from=$value item=line}\n{$line.description|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} ... \n{/foreach}\n{/if}\n' WHERE id IN () [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1]"]
  )
  
  Aug 31 13:51:25  [info] $backTrace = #0 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(232): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
  #2 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error-&gt;__construct("DB Error: syntax error", -2, 16, (Array:2), "\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #3 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error-&gt;__construct(-2, 16, (Array:2), "\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #4 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223): PEAR-&gt;_raiseError(Object(DB_mysqli), NULL, -2, 16, (Array:2), "\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...", "DB_Error", TRUE)
  #5 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1907): PEAR-&gt;__call("raiseError", (Array:7))
  #6 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common-&gt;raiseError(-2, NULL, NULL, "\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...", "1064 ** You have an error in your SQL syntax; check the manual that correspon...")
  #7 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli-&gt;mysqliRaiseError()
  #8 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli-&gt;simpleQuery("\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #9 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2415): DB_common-&gt;query("\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #10 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1607): DB_DataObject-&gt;_query("\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #11 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(438): DB_DataObject-&gt;query("\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #12 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1394): CRM_Core_DAO-&gt;query("\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...", TRUE)
  #13 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Incremental/MessageTemplates.php(149): CRM_Core_DAO::executeQuery("\n        UPDATE civicrm_msg_template SET msg_text = %1 WHERE id IN ()", (Array:1))
  #14 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Incremental/General.php(143): CRM_Upgrade_Incremental_MessageTemplates-&gt;updateTemplates()
  #15 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Form.php(772): CRM_Upgrade_Incremental_General::updateMessageTemplate("&lt;br /&gt;Les exemplaires par défaut des modèles de message répertoriés ci-dessou...", "5.4.alpha1")
  #16 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php(111): CRM_Upgrade_Form-&gt;setPreUpgradeMessage("&lt;br /&gt;Les exemplaires par défaut des modèles de message répertoriés ci-dessou...", "5.0.1", "5.4.1")
  #17 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php(73): CRM_Upgrade_Page_Upgrade-&gt;runIntro()
  #18 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(309): CRM_Upgrade_Page_Upgrade-&gt;run((Array:2), NULL)
  #19 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
  #20 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:2))
  #21 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm.php(1246): CRM_Core_Invoke::invoke((Array:2))
  #22 /var/www/html/civicrm/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress-&gt;invoke("")
  #23 /var/www/html/civicrm/wp-includes/class-wp-hook.php(310): WP_Hook-&gt;apply_filters("", (Array:1))
  #24 /var/www/html/civicrm/wp-includes/plugin.php(453): WP_Hook-&gt;do_action((Array:1))
  #25 /var/www/html/civicrm/wp-admin/admin.php(224): do_action("toplevel_page_CiviCRM")
  #26 {main}
  </code></pre>
  
  <p>I really don't know how to move forward and run the upgrade script.
  Any help will be kindly accepted
  Thanks</p>
  
  <p><a href="https://i.sstatic.net/XF8hy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XF8hy.png" alt="DB view, msg_template table"></a>
  <a href="https://i.sstatic.net/Nn55O.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Nn55O.png" alt="UI view"></a>
  <a href="https://i.sstatic.net/6n0Cv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6n0Cv.png" alt="civicrm_option_value table"></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-31T12:12:13.230Z
Comments.Text: looks like the message template in your system is missing
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-31T12:24:38.157Z
Comments.Text: Thanks for jumping in, how could I fix that ? Do you have a sql query that I could run ?
Comments.UserDisplayName: ITSupport ERELOS
Tags: <upgrade>
Title: Upgrade script (5.0.1 to 5.4.1) / DB Syntax error - UPDATE civicrm_msg_template SET msg_text
ThreadText: # Upgrade script (5.0.1 to 5.4.1) / DB Syntax error - UPDATE civicrm_msg_template SET msg_text
  
  (Asked by: username_0 on 2018-08-31)
  
  Context : Wordpress  4.9.8–fr_FR, PHP version 7.0.22, libmysql - mysqlnd 5.0
  Hello
  When trying to run the upgrade script from 5.0.1 to 5.4.1, I got this issue : 
      Aug 31 13:51:25  [info] $Fatal Error Details = Array
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => handle
          )
  
      [code] => -2
      [message] => DB Error: syntax error
      [mode] => 16
      [debug_info] => 
          UPDATE civicrm_msg_template SET msg_text = '{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $receipt_text}\n{$receipt_text}\n{/if}\n{if $is_pay_later}\n\n===========================================================\n{$pay_later_receipt}\n===========================================================\n{else}\n\n{ts}Please print this receipt for your records.{/ts}\n{/if}\n\n{if $membership_assign && !$useForMember}\n===========================================================\n{ts}Membership Information{/ts}\n\n===========================================================\n{ts}Membership Type{/ts}: {$membership_name}\n{if $mem_start_date}{ts}Membership Start Date{/ts}: {$mem_start_date|crmDate}\n{/if}\n{if $mem_end_date}{ts}Membership End Date{/ts}: {$mem_end_date|crmDate}\n{/if}\n\n{/if}\n{if $amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{if !$useForMember && $membership_amount && $is_quick_config}\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{if $amount && !$is_separate_payment }\n{ts}Contribution Amount{/ts}: {$amount|crmMoney}\n-------------------------------------------\n{ts}Total{/ts}: {$amount+$membership_amount|crmMoney}\n{/if}\n{elseif !$useForMember && $lineItem and $priceSetID & !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n---------------------------------------------------------\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"}\n----------------------------------------------------------\n{foreach from=$value item=line}\n{$line.description|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} ... \n{/foreach}\n{/if}\n' WHERE id IN () [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1]"]
  )
  
  Aug 31 13:51:25  [info] $backTrace = #0 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(232): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
  #2 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: syntax error", -2, 16, (Array:2), "\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #3 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-2, 16, (Array:2), "\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #4 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -2, 16, (Array:2), "\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...", "DB_Error", TRUE)
  #5 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
  #6 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-2, NULL, NULL, "\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...", "1064 ** You have an error in your SQL syntax; check the manual that correspon...")
  #7 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
  #8 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #9 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2415): DB_common->query("\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #10 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query("\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #11 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(438): DB_DataObject->query("\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...")
  #12 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1394): CRM_Core_DAO->query("\n        UPDATE civicrm_msg_template SET msg_text = '{assign var=\\"greeting...", TRUE)
  #13 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Incremental/MessageTemplates.php(149): CRM_Core_DAO::executeQuery("\n        UPDATE civicrm_msg_template SET msg_text = %1 WHERE id IN ()", (Array:1))
  #14 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Incremental/General.php(143): CRM_Upgrade_Incremental_MessageTemplates->updateTemplates()
  #15 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Form.php(772): CRM_Upgrade_Incremental_General::updateMessageTemplate("Les exemplaires par défaut des modèles de message répertoriés ci-dessou...", "5.4.alpha1")
  #16 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php(111): CRM_Upgrade_Form->setPreUpgradeMessage("Les exemplaires par défaut des modèles de message répertoriés ci-dessou...", "5.0.1", "5.4.1")
  #17 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php(73): CRM_Upgrade_Page_Upgrade->runIntro()
  #18 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(309): CRM_Upgrade_Page_Upgrade->run((Array:2), NULL)
  #19 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
  #20 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:2))
  #21 /var/www/html/civicrm/wp-content/plugins/civicrm/civicrm.php(1246): CRM_Core_Invoke::invoke((Array:2))
  #22 /var/www/html/civicrm/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress->invoke("")
  #23 /var/www/html/civicrm/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
  #24 /var/www/html/civicrm/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
  #25 /var/www/html/civicrm/wp-admin/admin.php(224): do_action("toplevel_page_CiviCRM")
  #26 {main}
  
  I really don't know how to move forward and run the upgrade script.
  Any help will be kindly accepted
  Thanks
  
  **Tags:** upgrade
  
  > **Comments:**
  > **username_1**: looks like the message template in your system is missing  
  > **username_0**: Thanks for jumping in, how could I fix that ? Do you have a sql query that I could run ?  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_2 on 2018-10-10. Score: 2 | Accepted answer
  
  This seems to be fixed in 5.6.0. If you have to upgrade to 5.5.1 or have problems so need to do it incrementally, at the suggestion of Aidan@Squiffle commenting out the `UPDATE civicrm_msg_template SET msg_{$template['type']}` command at the bottom of CiviCRM/CRM/Upgrade/Incremental/MessageTemplates.php seemed to work.
  
  > **Comments:**
  > **username_0**: Thank you very much ! I managed upgrading by commenting the recommended lines in CiviCRM/CRM/Upgrade/Incremental/MessageTemplates.php  
  > **username_0**: Following the upgrade to 5.4.1, I upgraded to 5.8.2 but got the same issue than before -> so doesn't seem to be fixed by 5.6. I had to comment the same lines in  MessageTemplates.php and the upgrade successfully moved forward.  
  > **username_2**: Glad it's now working. To dble check, are you saying that having fixed it for 5.4.1 to 5.6.0, you then had to correct it again when you upgraded to 5.8.2? Or just when you went 5.4.1 to 5.8.2?  
  > **username_0**: I went directly to 5.8.2 from 5.4.1 :( did get the opportunity to check with 5.6 - Thanks again !  
  
  ---
  
  ### Answer by username_3 on 2018-11-02. Score: 1
  
  I'm sorry not to post in the comments but I do not have 50 points yet.
  
  @username_2 , can you explain your answer better? from version 5.4 exists the file MessageTemplates.php but (in WordPress) however does not update from 5.3.2 to 5.4
  
  @Tellie , did you solve the problem?
  
  > **Comments:**
  > **username_2**: Just seen this - sorry for the delay. If you've not fixed it yet - do you have the same problem upgrading to 5.6 or 5.7? If so then maybe commenting out that command should help? I've not tried on WP tho, sorry, just Joomla.  
  
  ---
  
  ### Answer by username_4 on 2018-10-03. Score: 0
  
  Have you ever found an fix for this issue? I got the exact same problem when upgrading from 5.3.2 to 5.6.0 or for that case any higher version then 5.3.2. I think it's a bug in the upgrader because I checked the civicrm\_msg\_template table to the original SQL schema and there are no differences.
  
  > **Comments:**
  > **username_5**: Hi username_4,Comments should be used if what you are posting is not an answer to the question being asked. You might want to delete your answer and post it as a comment to avoid down votes.  
  > **username_4**: If StackExchange would allow me to, I get the notification 'You must have 50 reputation to comment'....  
  
  ---
  
  ### Answer by username_1 on 2018-08-31. Score: 0
  
  I guess your system has either missing 'Event Online Receipt' message template or the template is not reserved. Check by running below query if it returns result.
  SELECT id FROM civicrm_msg_template WHERE workflow_id IN (SELECT MAX(id) as id FROM civicrm_option_value WHERE name = 'event_online_receipt') AND is_reserved = 1
  
  > **Comments:**
  > **username_0**: Indeed no result return, how should i fix that ? Thanks !  
  > **username_0**: This is one also return no result : SELECT id FROM civicrm_msg_template WHERE workflow_id IN (SELECT MAX(id) as id FROM civicrm_option_value WHERE name = 'event_offline_receipt') AND is_reserved = 1 ;(event_offline_receipt)  
  > **username_1**: Can you try running the query by running without is_reserved = 1  
  > **username_0**: SELECT id FROM civicrm_msg_template WHERE workflow_id IN (SELECT MAX(id) as id FROM civicrm_option_value WHERE name = 'event_online_receipt'); no result  
  > **username_0**: SELECT id FROM civicrm_msg_template WHERE workflow_id IN (SELECT MAX(id) as id FROM civicrm_option_value WHERE name = 'event_offline_receipt'); no result  
  > **username_1**: Can you check Message template if you can see Event Online and Offline templates?  
  > **username_1**: Can you check through CiviCRM UI  
  > **username_0**: Please see issue description for screenshots, UI (in French) & DB (msg_template) and (option_value). Do you see something wrong ? How can we move forward ? Thanks for your help  
  > **username_0**: do you have any additional guidelines that may help us to troubleshoot ? thank you very much.  
  > **username_0**: @pradpnayak hello, do you have any advice to get this issue solved ? thanks in advance  
  > **username_1**: its difficult to predict query unless i can look into the db entries. And i don't want to provide queries that would affect your whole database.  
  
  ---
  
  