<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Installing third party extensions broken and FIX]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7185</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7185&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Installing third party extensions broken and FIX.]]></description>
		<lastBuildDate>Fri, 15 Dec 2017 07:33:39 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Installing third party extensions broken and FIX]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30001#p30001</link>
			<description><![CDATA[<p>@joe: Thanks. <a href="https://github.com/FrontAccountingERP/FA/commit/074e859275e21fa17943e19ade8ef75dbefea9d2">Committed</a>.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 15 Dec 2017 07:33:39 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30001#p30001</guid>
		</item>
		<item>
			<title><![CDATA[Installing third party extensions broken and FIX]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29999#p29999</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 15 Dec 2017 05:52:31 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29999#p29999</guid>
		</item>
	</channel>
</rss>
