<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Missing function 'delete_image' when trying to delete an Item]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=9669&amp;type=atom" />
	<updated>2022-01-25T03:00:25Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=9669</id>
		<entry>
			<title type="html"><![CDATA[Re: Missing function 'delete_image' when trying to delete an Item]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=40553#p40553" />
			<content type="html"><![CDATA[<p>The committed fix now renames the function <strong>del_image</strong> to <strong>delete_image</strong> as used in the codebase. The re-run of the commit now changes the usage to <strong>del_image</strong> and rolls back the function name change.</p><p>This error in coding occurred as the earlier function name was used as the $_POST variable from the form.</p><p>Such usages are in some extensions as well - <a href="https://github.com/apmuthu/FA24extensions/blob/master/Extensions/additional_fields/manage/add_items.php"><strong>additional_fields</strong></a> and <a href="https://github.com/apmuthu/FA24extensions/blob/master/Extensions/fronthrm/manage/employee.php"><strong>fronthrm</strong></a> but mostly as $_POST variables.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2022-01-25T03:00:25Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=40553#p40553</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Missing function 'delete_image' when trying to delete an Item]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=40544#p40544" />
			<content type="html"><![CDATA[<p>Fixed and committed to stable.</p><p>Thanks for finding this.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2022-01-24T07:58:54Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=40544#p40544</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Missing function 'delete_image' when trying to delete an Item]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=40541#p40541" />
			<content type="html"><![CDATA[<p>@joe: Kindly fix this.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2022-01-24T03:02:04Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=40541#p40541</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Missing function 'delete_image' when trying to delete an Item]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=40533#p40533" />
			<content type="html"><![CDATA[<p>Looks like it should be <strong>del_image</strong> instead of <em>delete_image</em>.</p><p>The function is defined in <strong>inventory/manage/items.php</strong> at 59 to 67:<br /></p><div class="codebox"><pre><code>function del_image($stock_id)
{
    foreach (array(&#039;jpg&#039;, &#039;png&#039;, &#039;gif&#039;) as $ext) {
        $filename = company_path().&#039;/images/&#039;.item_img_name($stock_id).&quot;.&quot;.$ext;
        if (file_exists($filename) &amp;&amp; !unlink($filename))
            return false;
    }
    return true;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2022-01-23T16:03:12Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=40533#p40533</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Missing function 'delete_image' when trying to delete an Item]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=40532#p40532" />
			<content type="html"><![CDATA[<p>Which version of FA, PHP and MySQL are you using?</p><p>Line 338 of <strong>inventory/manage/items.php</strong> is:<br /></p><div class="codebox"><pre><code>        delete_image($stock_id);</code></pre></div><p>The said function literal is absent in whole of the FA codebase and wonder how the image gets deleted.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2022-01-23T15:45:58Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=40532#p40532</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Missing function 'delete_image' when trying to delete an Item]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=40530#p40530" />
			<content type="html"><![CDATA[<p>When I try to delete an item, it throws an error about a missing function:</p><p>Unhandled exception [0]: Call to undefined function delete_image(). in file: /xxx/xxx/fa/inventory/manage/items.php at line 338</p><p>It will still remove the item while throwing this error.<br />Thanks</p>]]></content>
			<author>
				<name><![CDATA[brucek@pelhamhs.org]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41547</uri>
			</author>
			<updated>2022-01-23T14:00:23Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=40530#p40530</id>
		</entry>
</feed>
