<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Uninstall user module error]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=5983</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5983&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Uninstall user module error.]]></description>
		<lastBuildDate>Mon, 12 Oct 2015 18:24:11 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Uninstall user module error]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=24487#p24487</link>
			<description><![CDATA[<p>The <a href="https://frontaccounting.com/fawiki/index.php?n=Devel.TrobleshootingFrontAccounting">Wiki</a> has the variables inspected but may not be relevant here except as a means to investigate.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 12 Oct 2015 18:24:11 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=24487#p24487</guid>
		</item>
		<item>
			<title><![CDATA[Re: Uninstall user module error]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=24483#p24483</link>
			<description><![CDATA[<p>Okay, I will look into it.</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 12 Oct 2015 17:31:37 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=24483#p24483</guid>
		</item>
		<item>
			<title><![CDATA[Uninstall user module error]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=24478#p24478</link>
			<description><![CDATA[<p>If a user uploads a module into the modules folder, there will be no corresponding <strong>_init/config file</strong> in the <strong>modules/_cache</strong> folder. Installing the module goes without any issue (since it is already in place, but will benefit from such a check as well) but uninstalling it causes the error: &quot;Cannot download repo index file.&quot;.</p><p>This is because the function <strong>uninstall()</strong> in <strong>includes/packages.inc</strong> attempts:<br /></p><div class="codebox"><pre><code>        $ctrl = get_control_file(&quot;$cachepath/_init/config&quot;);</code></pre></div><p>without checking if the file exists!</p><p>Preceding it with the following and encompassing the next few statements within it should alleviate it:<br /></p><div class="codebox"><pre><code>if (file_exists(&quot;$cachepath/_init/config&quot;)) {
        $ctrl = get_control_file(&quot;$cachepath/_init/config&quot;);

        $targetdir = $path_to_root.&#039;/&#039;.$ctrl[&#039;InstallPath&#039;];

        $dpackage = new package(&quot;$cachepath/_data&quot;, $targetdir);

        $flist = $dpackage-&gt;extract_files(true);

        $success &amp;= copy_files($flist, &quot;$cachepath/_back&quot;, $targetdir, true);
}</code></pre></div><p>This will of course not purge the module from the <strong>modules</strong> folder ($ctrl[&#039;InstallPath&#039;] is undefined) but will remove the module&#039;s entry from the <strong>installed_extensions.php</strong> files.</p><br /><p>@joe: please verify and incorporate in the stable repo.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 12 Oct 2015 08:58:48 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=24478#p24478</guid>
		</item>
	</channel>
</rss>
