<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Installing third party extensions broken and FIX]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7185&amp;type=atom" />
	<updated>2017-12-15T07:33:39Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7185</id>
		<entry>
			<title type="html"><![CDATA[Re: Installing third party extensions broken and FIX]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=30001#p30001" />
			<content type="html"><![CDATA[<p>@joe: Thanks. <a href="https://github.com/FrontAccountingERP/FA/commit/074e859275e21fa17943e19ade8ef75dbefea9d2">Committed</a>.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-12-15T07:33:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=30001#p30001</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Installing third party extensions broken and FIX]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29999#p29999" />
			<content type="html"><![CDATA[<p>In 2011, <a href="https://frontaccounting.com/punbb/viewtopic.php?pid=8056#p8056">local install of packages</a> was introduced where the hooks.php would encompass all install tasks - but that is available in the target company only after activation and not in the default company for the available extensions and their install buttons where the version is &quot;Unknown&quot; and the name is the folder name itself.</p><p><a href="https://frontaccounting.com/punbb/viewtopic.php?pid=28373#p28373">This post</a> shows how the third party extensions get listed in the <strong>installed_extensions.php</strong> file as <strong>version&nbsp; =&gt; &#039;-&#039; ,</strong> whereas, it is listed as blank elsewhere so that the &quot;Install Extension&quot; icon in the extensions listing gets enabled. This happens at the end of <strong>includes/packages.inc</strong>:<br /></p><div class="codebox"><pre><code>/*
    Check basic extension source compatibility.
*/
function check_src_ext_version($ext_v)
{
    global $src_version;

    $compat_levels = 2;    // current policy is keeping compatibility on major version level.
    $app = explode(&#039;.&#039;, substr($src_version, 0, strspn($src_version, &quot;0123456789.&quot;)));
    $pkg = explode(&#039;.&#039;, substr($ext_v, 0, strspn($ext_v, &quot;0123456789.&quot;)));

    for ($i=0; $i &lt; min($compat_levels, count($app)); $i++)
        if ($pkg[$i] &lt; $app[$i])
            return false;

    return true;
}</code></pre></div><p>which should now be corrected to be effective only when it is not a third party extension like:<br /></p><div class="codebox"><pre><code>/*
    Check basic extension source compatibility.
*/
function check_src_ext_version($ext_v)
{
    global $src_version;
    if ($ext_v != &#039;-&#039;) {
        $compat_levels = 2;    // current policy is keeping compatibility on major version level.
        $app = explode(&#039;.&#039;, substr($src_version, 0, strspn($src_version, &quot;0123456789.&quot;)));
        $pkg = explode(&#039;.&#039;, substr($ext_v, 0, strspn($ext_v, &quot;0123456789.&quot;)));

        for ($i=0; $i &lt; min($compat_levels, count($app)); $i++)
            if ($pkg[$i] &lt; $app[$i])
                return false;
    }
    return true;
}</code></pre></div><p>The logic to display the &quot;Install extension&quot; button/icon should be altered to read from a <strong>_init/config</strong> file if present in the third party module folder itself thereby populating the <strong>version</strong> and <strong>name</strong> fields as well instead of being &quot;-&quot; and folder name respectively as obtains now.</p><p>Currently the presence of a Version in the _init/config file in the official packages is provided to the <strong>available</strong> parameter on install when extracted using the function <strong>get_extensions_list()</strong> defined in <strong>includes/packages.inc</strong>.</p><p>@joe: kindly incorporate the fix listed here for a start so that third party installs do not get broken and / or resorting to use kludgy workarounds.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-12-15T05:52:31Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29999#p29999</id>
		</entry>
</feed>
