<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Bug submitting forms in FA 2.3.x when file field not changed]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6611&amp;type=atom" />
	<updated>2016-12-23T07:59:26Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=6611</id>
		<entry>
			<title type="html"><![CDATA[Re: Bug submitting forms in FA 2.3.x when file field not changed]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27219#p27219" />
			<content type="html"><![CDATA[<p>Thanks, well it seems to work without sideeffects.</p><p>Both stable and unstable repos are updated.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2016-12-23T07:59:26Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27219#p27219</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug submitting forms in FA 2.3.x when file field not changed]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27218#p27218" />
			<content type="html"><![CDATA[<p>No customisation, no extensions.<br />Plain vanilla install of FA 2.3.25+ from official GitHub Master. <br />en_US-demo.sql - CoA with US demo data.</p><p>Test Environment:<br />Server and client (localhost) on WinXPSp3, XAMPP 1.7.3 having:<br />MySQL Server &amp; Client version: 5.1.41<br />Apache/2.2.14<br />PHP Version 5.3.1<br />Browser FireFox v37.0.2</p><p>This change is important as there could be some instances where during some var scope / js / function execution, the value of a POSTed checkbox variable is set to 0 as would obtain when &quot;cleaning&quot; of POST variables occur. In such an instance, <strong>mere</strong> checking for the existence of the POST variable would be insufficient, it&#039;s value must be 1 (for single checkbox value as prevalent in all if not most of FA) or some pre-set value (some have the audacity to make it -1 when not chosen) and at the very least, that, if present, it should be checked if (not) zero.</p><p>Since no change is effected on the POSTed checkbox variable by the code using this function, please let me know how batch invoicing / delivery processing would be affected - do they change the value of the POSTed checkbox variable?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-12-23T04:19:35Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27218#p27218</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug submitting forms in FA 2.3.x when file field not changed]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27216#p27216" />
			<content type="html"><![CDATA[<p>Hello again,</p><p>I have talked with Janusz, and he agrees with that this is strange. Form sent by browser should not include unset<br />checkboxes, and in ajax it should be forced by FA javascript code.</p><p>Please, apmuthu, check that there are no problems in your environment. Please state your configuration details where the problem arises (browser type/system, php server version etc). I guess this arises on some customized FA installation, maybe due to some conflict with third party javascript?</p><p>Janusz is afraid of possible sideeffects in batch invoicing and invoicing from deliveries. Please check if there are sideeffects.</p><p>If not, we can apply the patch.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2016-12-22T22:51:03Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27216#p27216</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug submitting forms in FA 2.3.x when file field not changed]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27214#p27214" />
			<content type="html"><![CDATA[<p>Fixed in <a href="https://github.com/apmuthu/frontaccounting/commit/78d0937e66aa2dc74fd3de3bcfdeb0270d92c7f9">my repo</a>.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-12-22T20:00:56Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27214#p27214</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug submitting forms in FA 2.3.x when file field not changed]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27185#p27185" />
			<content type="html"><![CDATA[<p>I think this is strange. Not normal behaviour for serious browsers. But I will let Janusz decide what?</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2016-12-22T10:14:31Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27185#p27185</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug submitting forms in FA 2.3.x when file field not changed]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27183#p27183" />
			<content type="html"><![CDATA[<p>@joe: Please fix in both versions.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-12-22T07:03:35Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27183#p27183</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Bug submitting forms in FA 2.3.x when file field not changed]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27146#p27146" />
			<content type="html"><![CDATA[<p>Try this:<br />Setup =&gt; Company Setup =&gt; Save</p><p>Even though the checkbox &quot;Delete Company Logo&quot; is unchecked and there is no change in the logo file that exists, the changes in other fields do not get saved and the error: <strong>The existing image could not be removed</strong> arises.</p><p>This is due to the fact that the <strong>function check_value()</strong> only checks if the checkbox element exists in the $_POST and not if it&#039;s value is set to 1 - some browsers (versions) and windows OSes tested in FA 2.3.x (test on other combinations and even in FA 2.4.x for corrections like this) need the said function in <strong>includes/ui/ui_input.inc</strong>:<br /></p><div class="codebox"><pre><code>function check_value($name)
{
    if (!isset($_POST[$name]))
        return 0;
    return 1;
}</code></pre></div><p>to be<br /></p><div class="codebox"><pre><code>function check_value($name)
{
    if (!isset($_POST[$name]) || !$_POST[$name])
        return 0;
    return 1;
}</code></pre></div><p>0 is generally evaluates false and if 1 is the value of a ticked checkbox enforced throughout FA, then a NOT check of 1 can be used.</p><p>In fact, a very thorough check to accomodate unlike variable type comparisions would entail:<br /></p><div class="codebox"><pre><code>function check_value($name)
{
    if (!isset($_POST[$name]) || ($_POST[$name]+0) === 0)
        return 0;
    return 1;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-12-22T04:26:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27146#p27146</id>
		</entry>
</feed>
