<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Uninstall user module error]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5983&amp;type=atom" />
	<updated>2015-10-12T18:24:11Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=5983</id>
		<entry>
			<title type="html"><![CDATA[Re: Uninstall user module error]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24487#p24487" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2015-10-12T18:24:11Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24487#p24487</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Uninstall user module error]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24483#p24483" />
			<content type="html"><![CDATA[<p>Okay, I will look into it.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2015-10-12T17:31:37Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24483#p24483</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Uninstall user module error]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24478#p24478" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2015-10-12T08:58:48Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24478#p24478</id>
		</entry>
</feed>
