<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=10660&amp;type=atom" />
	<updated>2025-05-13T14:49:08Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=10660</id>
		<entry>
			<title type="html"><![CDATA[Re: PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43646#p43646" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2025-05-13T14:49:08Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43646#p43646</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43643#p43643" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[brucek@pelhamhs.org]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41547</uri>
			</author>
			<updated>2025-05-09T12:35:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43643#p43643</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43642#p43642" />
			<content type="html"><![CDATA[<p>is <strong>E_USER_NOTICE</strong> available in older PHP versions say 5.x ?<br />Any best practice for safe degradation?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2025-05-09T11:25:51Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43642#p43642</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43640#p43640" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2025-05-09T08:32:17Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43640#p43640</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[PHP 8.4 trigger_error($msg, E_USER_ERROR) obsolete]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43638#p43638" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[brucek@pelhamhs.org]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41547</uri>
			</author>
			<updated>2025-05-05T16:08:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43638#p43638</id>
		</entry>
</feed>
