<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Missing function 'delete_image' when trying to delete an Item]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=9669</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=9669&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Missing function 'delete_image' when trying to delete an Item.]]></description>
		<lastBuildDate>Tue, 25 Jan 2022 03:00:25 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Missing function 'delete_image' when trying to delete an Item]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=40553#p40553</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 25 Jan 2022 03:00:25 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=40553#p40553</guid>
		</item>
		<item>
			<title><![CDATA[Re: Missing function 'delete_image' when trying to delete an Item]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=40544#p40544</link>
			<description><![CDATA[<p>Fixed and committed to stable.</p><p>Thanks for finding this.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 24 Jan 2022 07:58:54 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=40544#p40544</guid>
		</item>
		<item>
			<title><![CDATA[Re: Missing function 'delete_image' when trying to delete an Item]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=40541#p40541</link>
			<description><![CDATA[<p>@joe: Kindly fix this.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 24 Jan 2022 03:02:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=40541#p40541</guid>
		</item>
		<item>
			<title><![CDATA[Re: Missing function 'delete_image' when trying to delete an Item]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=40533#p40533</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 23 Jan 2022 16:03:12 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=40533#p40533</guid>
		</item>
		<item>
			<title><![CDATA[Re: Missing function 'delete_image' when trying to delete an Item]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=40532#p40532</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 23 Jan 2022 15:45:58 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=40532#p40532</guid>
		</item>
		<item>
			<title><![CDATA[Missing function 'delete_image' when trying to delete an Item]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=40530#p40530</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (brucek@pelhamhs.org)]]></author>
			<pubDate>Sun, 23 Jan 2022 14:00:23 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=40530#p40530</guid>
		</item>
	</channel>
</rss>
