{"id":254,"date":"2018-02-02T11:46:07","date_gmt":"2018-02-02T17:46:07","guid":{"rendered":"https:\/\/help.marketingservices.dev\/?p=254"},"modified":"2020-11-27T10:37:43","modified_gmt":"2020-11-27T16:37:43","slug":"betheme-theme-500-error","status":"publish","type":"post","link":"https:\/\/help.marketingservices.dev\/?p=254","title":{"rendered":"Troubleshooting: 500 Error while using BeTheme"},"content":{"rendered":"<h2>Problem<\/h2>\n<p>Older versions of Betheme theme has code that is incompatible with PHP 7. From Version 20.8.4 this issue should be rectified, but you might find that older versions that are bundled with themes may not support PHP 7.<\/p>\n<p>In the case where you have an incompatible Betheme theme installed, it may result in a 500 error when updating the pages\/posts which are using this theme.<\/p>\n<h2>Solution<\/h2>\n<p>Firstly, Set up an SFTP user using an SFTP client like FileZilla and use SFTP to access the file system as <a href=\"https:\/\/help.marketingservices.dev\/?p=202\" target=\"_blank\" rel=\"noopener noreferrer\">explained here<\/a><\/p>\n<p>Secondly, open the file\u00a0<strong>\/wp\/wp-content\/themes\/betheme\/functions\/builder\/back.php<\/strong><\/p>\n<p>Somewhere around line 918, you\u2019ll find the line:<\/p>\n<pre><em><strong>    $mfn_wraps[$parent_wrap_ID]['items'][] = $item;<\/strong><\/em><\/pre>\n<p>It must be changed to:<\/p>\n<pre><em><strong>    if (!is_array($mfn_wraps[$parent_wrap_ID]['items'])) {\r\n        $mfn_wraps[$parent_wrap_ID]['items'] = array();\r\n    }\r\n    $mfn_wraps[$parent_wrap_ID]['items'][] = $item;<\/strong><\/em><\/pre>\n<p>Somewhere around line 930, you&#8217;ll find the line:<\/p>\n<pre><em><strong>    $mfn_wraps[$section_key]['wraps'][] = $wrap;\r\n<\/strong><\/em><\/pre>\n<p>It must be changed to:<\/p>\n<pre class=\"code-java\"><em><strong><span class=\"code-keyword\">    if<\/span> (!is_array($mfn_items[$section_key][<span class=\"code-quote\">'wraps'<\/span>])) {\r\n        $mfn_items[$section_key][<span class=\"code-quote\">'wraps'<\/span>] = array();\r\n    }\r\n    $mfn_items[$section_key][<span class=\"code-quote\">'wraps'<\/span>][] = $wrap;\r\n\r\n<\/strong><\/em><\/pre>\n<p>This fix should allow you to update Betheme related pages\/posts again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem Older versions of Betheme theme has code that is incompatible with PHP 7. From Version 20.8.4 this issue should be rectified, but you might find that older versions that are bundled with themes may not support PHP 7. In the case where you have an incompatible Betheme theme installed, it may result in a [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/help.marketingservices.dev\/index.php?rest_route=\/wp\/v2\/posts\/254"}],"collection":[{"href":"https:\/\/help.marketingservices.dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.marketingservices.dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.marketingservices.dev\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/help.marketingservices.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=254"}],"version-history":[{"count":3,"href":"https:\/\/help.marketingservices.dev\/index.php?rest_route=\/wp\/v2\/posts\/254\/revisions"}],"predecessor-version":[{"id":503,"href":"https:\/\/help.marketingservices.dev\/index.php?rest_route=\/wp\/v2\/posts\/254\/revisions\/503"}],"wp:attachment":[{"href":"https:\/\/help.marketingservices.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.marketingservices.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.marketingservices.dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}