<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=10660</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=10660&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete.]]></description>
		<lastBuildDate>Tue, 13 May 2025 14:49:08 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43646#p43646</link>
			<description><![CDATA[<p>Looks like the extensions too must have the function <strong>trigger_error</strong> replaced by <strong>fa_trigger_error</strong> too.</p><p>osc_orders/osCommerce.php<br /></p><div class="codebox"><pre><code>    $result = mysqli_query($osc, $sql) or trigger_error(&quot;Query Failed! SQL: $sql - Error: &quot;.mysqli_error($osc), E_USER_ERROR);</code></pre></div><p>api24/sales.inc<br /></p><div class="codebox"><pre><code>    if ($can_process[&#039;passed&#039;] == false) {
        trigger_error(var_export($can_process, true));
        api_error(412, $can_process[&#039;message&#039;]);
        return;
    }</code></pre></div><p>The commit at: https://github.com/FrontAccountingERP/FA/commit/7092ac6864fd902b61d2c01ba694c4b5dba703fb<br />solves this issue for the core.</p><p>Additionally, the original function trigger_error() could have been retained for those using older extensions with older PHP versions and code.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 13 May 2025 14:49:08 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43646#p43646</guid>
		</item>
		<item>
			<title><![CDATA[Re: PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43643#p43643</link>
			<description><![CDATA[<p>It looks like E_USER_ERROR is valid for trigger_error() up until 8.4.0</p><p>This from https://www.php.net/manual/en/errorfunc.constants.php#constant.e-user-error</p><br /><p>E_USER_ERROR (int)</p><p>User-generated error message. This is like an E_ERROR, except it is generated in PHP code by using the PHP function trigger_error(). Value of the constant: 256</p><p>Warning<br />Usage of this constant with trigger_error() is deprecated as of PHP 8.4.0. It is recommended to either throw an Exception or call exit() instead.</p>]]></description>
			<author><![CDATA[null@example.com (brucek@pelhamhs.org)]]></author>
			<pubDate>Fri, 09 May 2025 12:35:43 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43643#p43643</guid>
		</item>
		<item>
			<title><![CDATA[Re: PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43642#p43642</link>
			<description><![CDATA[<p>is <strong>E_USER_NOTICE</strong> available in older PHP versions say 5.x ?<br />Any best practice for safe degradation?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 09 May 2025 11:25:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43642#p43642</guid>
		</item>
		<item>
			<title><![CDATA[Re: PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43640#p43640</link>
			<description><![CDATA[<p>Hi, thanks for this.<br />I have detected the same problem in 8.4 when working in an nginx container with php 8.4.5. I will just contact @itronics to see if he like this idea.</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Fri, 09 May 2025 08:32:17 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43640#p43640</guid>
		</item>
		<item>
			<title><![CDATA[PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43638#p43638</link>
			<description><![CDATA[<p>I guess calling trigger_error($msg, E_USER_ERROR) is obsoleted in 8.4....</p><p>My quick fix was to modify:</p><p>includes\errors.inc</p><p>- add line 26 :&nbsp; <br />$bt = ($errno == E_USER_ERROR or $errno ==&nbsp; E_USER_WARNING) ? &quot;&quot; : $bt;</p><p>- replace line 96:&nbsp; <br />error_handler($exception-&gt;getCode(), sprintf(_(&quot;Unhandled exception [%s]: %s.&quot;), $exception-&gt;getCode(), $exception-&gt;getMessage()), $exception-&gt;getFile(), $exception-&gt;getLine());<br />_________________</p><p>modify includes\ui\ui_msgs.inc</p><p>- replace line 14: <br />error_handler(E_USER_ERROR, $msg, &quot;&quot;,&quot;&quot;);</p><p>- replace line 19: <br />error_handler(E_USER_NOTICE, $msg, &quot;&quot;,&quot;&quot;);</p>]]></description>
			<author><![CDATA[null@example.com (brucek@pelhamhs.org)]]></author>
			<pubDate>Mon, 05 May 2025 16:08:39 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43638#p43638</guid>
		</item>
	</channel>
</rss>
