<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — reports_classes.inc:40: count()]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7782&amp;type=atom" />
	<updated>2019-10-06T10:01:04Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7782</id>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36200#p36200" />
			<content type="html"><![CDATA[<p>All <strong>reporting/repXXX.php</strong> files call the <strong>reporting/includes/pdf_reports.inc</strong> based on destination chosen in the report request form.</p><p>All <strong>reporting/repXXX.php</strong> files are called only from <strong>reporting/reports_main.php</strong> which in turn &quot;includes&quot; the <strong>includes/ui.inc</strong> and that in turn &quot;includes&quot; the <strong>includes/ui/ui_globals.inc</strong> file (among others) that defines the <strong>function count_array()</strong>.</p><p>Hence no need for separate inclusion of <strong>includes/ui/ui_globals.inc</strong> except when the reports are used <span class="bbu">independent of the above file</span>.</p><p>Wonder why Line 374 was left out from such a change in <strong>reporting/includes/pdf_report.inc</strong>.<br /></p><div class="codebox"><pre><code>        $count = count($this-&gt;headers2);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-10-06T10:01:04Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36200#p36200</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36199#p36199" />
			<content type="html"><![CDATA[<p>We only need to include the 2 changes made by @notrinos.<br />The inclusion of the ui_globals.inc has already been done in other places.</p><p><a href="https://github.com/FrontAccountingERP/FA/commit/44a7cb94d5002065a18471e4b6f0f8a882d7cd0e">Committed</a> to repo 2.4.7 stable.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2019-10-06T08:06:30Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36199#p36199</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36193#p36193" />
			<content type="html"><![CDATA[<p>Search for &quot;count(&quot; in the <strong>reporting/includes/pdf_report.inc</strong> and we find 15 occurrences that need to be replaced with &quot;count_array(&quot;</p><p>@joe: can commit this along with the inclusion of <strong>includes/ui/ui_globals.inc</strong> in it.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-10-05T18:15:02Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36193#p36193</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36191#p36191" />
			<content type="html"><![CDATA[<p><strong>pdf_report.inc</strong> lines 344 and 379 may need <em>count_array()</em> also.<br />And <strong>includes/ui/ui_globals.inc</strong> has to be included here since <strong>function count_array()</strong> is defined there.</p>]]></content>
			<author>
				<name><![CDATA[notrinos]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36772</uri>
			</author>
			<updated>2019-10-05T13:10:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36191#p36191</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33447#p33447" />
			<content type="html"><![CDATA[<p>These files have been committed to stable repo. Just replace the count() with count_array() in both places.</p><p>Thanks @notrinos for finding these.</p><p>Please continue testing. Thanks in advance.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2018-11-29T13:20:24Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33447#p33447</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33443#p33443" />
			<content type="html"><![CDATA[<p>There are still some where<br /></p><ol class="decimal"><li><p><strong>/includes/ui/items_cart.inc line 312</strong>. Error firing on Modifying Journal Transaction</p></li><li><p><strong>/includes/ui/contacts_view.inc line 137</strong>. Error firing on Add Customer Contact without selecting Contact Category </p></li></ol>]]></content>
			<author>
				<name><![CDATA[notrinos]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36772</uri>
			</author>
			<updated>2018-11-29T09:43:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33443#p33443</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33442#p33442" />
			<content type="html"><![CDATA[<p>I have now committed a fix, where the count() was replaced with count_array(). It was only needed in 3 files and the count_array() was added at the end in the file /includes/ui/ui_globals.inc.</p><p>The files are:<br />/admin/db/maintenance_db.inc(186): $cnt = max(1, count_array($db_connections));<br />/reporting/includes/reports_classes.inc(37): $class_id = count_array($this-&gt;ar_classes);<br />/sales/includes/sales_db.inc(371): if (!count_array($trans_no))</p><p>and the count_array definition:<br />/includes/ui/ui_globals.inc(65): function count_array($array)</p><p>I have been testing FA all over, but I will ask you who has the PHP 7.2.X installed to download a snapshot of 2.4.4 from the repo <a href="https://sourceforge.net/p/frontaccounting/git/ci/master/tree/">here</a>.</p><p>There was also a problem with the 2.nd parameter in number_format2 in the file /includes/current_user.inc. We used a float value as an integer parameter. Fixed with intval().</p><p>Please help me test this snapshot so we can find more odd count() and other problems.</p><p>Thank you in advance.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2018-11-29T08:37:50Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33442#p33442</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33439#p33439" />
			<content type="html"><![CDATA[<p>Yes, they are part of the Advanced PHP debugger.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-11-29T03:58:30Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33439#p33439</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33433#p33433" />
			<content type="html"><![CDATA[<p>I see that the functions rename_function and override_function are not part of the standard PHP and therefore can not be used.</p><p>I will follow @cleal example and review all the count() calls. Where the check is needed I will use the count_array() instead of&nbsp; count().</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2018-11-28T22:26:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33433#p33433</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33430#p33430" />
			<content type="html"><![CDATA[<p>@joe: Line 186 in <strong>admin/db/maintenance_db.inc</strong> can be preceded with:<br /></p><div class="codebox"><pre><code>if (!(is_array($db_connections)) $db_connections = array($db_connections);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-11-28T16:26:00Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33430#p33430</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33429#p33429" />
			<content type="html"><![CDATA[<p>I will test a solution with rename_function and override_function.<br />We will include a new file with specific functions with new behaviors if<br />&nbsp; version_compare &gt;= 7.2.0</p><p>Then we do not need to change anything in the code.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2018-11-28T16:20:22Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33429#p33429</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33427#p33427" />
			<content type="html"><![CDATA[<p>Line 186 file maintenance_db.inc also needs array check function.<br />Error raising on Installation Wizard step 5.</p>]]></content>
			<author>
				<name><![CDATA[notrinos]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36772</uri>
			</author>
			<updated>2018-11-28T14:55:20Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33427#p33427</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33089#p33089" />
			<content type="html"><![CDATA[<p>I think, into /includes/ui/ one file named like that.&nbsp; In this add all functions to fix issues of deprecated functions or fix others.</p><p>And then, add include into /includes/ui.inc</p>]]></content>
			<author>
				<name><![CDATA[cleal]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=43428</uri>
			</author>
			<updated>2018-10-31T20:27:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33089#p33089</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33087#p33087" />
			<content type="html"><![CDATA[<p>All such PHP 7.x gotchas can be made into a separate <strong>php7.php</strong> file to be <strong>include</strong>d if a PHP7.x version is in use.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-10-31T18:47:38Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33087#p33087</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reports_classes.inc:40: count()]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33082#p33082" />
			<content type="html"><![CDATA[<p>Yes maybe a good idea.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2018-10-31T06:12:21Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33082#p33082</id>
		</entry>
</feed>
