Post by aleopencart » Sat Jul 25, 2020 12:55 pm

IP_CAM wrote:
Sat Jul 25, 2020 2:52 am
JNeuhoff's Integrated VQmod add's the modified Code to the Database, exactly like OcMods are 'handled',
instead of placing such Files in a Vqmod/Vqcache/ Subdirectory. It's probably the best and most efficient way of all,
since it avoids additional tasks, in order to create a Page. Not to speak about ERRORS, due to two Systems, unable
to communicate with each other, as VqMod and OcMod 'combined' should do, or better, cannot do. ;)
So, if you still use VqMods, for whatever unknown reason ever, use Integrated VQmod, you're better off ... ;)
Ernie
---
Integrated VQmod for OpenCart
https://www.opencart.com/index.php?rout ... n_id=19501
I don't doubt about the solution. But with vqmod it is faster to test the code to be rewritten without write code on database every time...

User avatar
New member

Posts

Joined
Tue Jul 12, 2016 11:57 pm

Post by JNeuhoff » Sat Jul 25, 2020 5:44 pm

aleopencart wrote:
Sat Jul 25, 2020 2:08 am
JNeuhoff wrote:
Fri Jul 24, 2020 9:55 pm
Once you fix the 'modification.xml', our Integrated VQmod should work just fine for OpenCart 3.0.3.5 and 3.0.3.6! I just tested it for OpenCart 3.0.3.6.
Please what's the fix for the modification.xml file that you have tested?
Use this modification.xml:

Code: Select all


<?xml version="1.0" encoding="utf-8"?>
<modification>
  <name>Modification Default</name>
  <code>default</code>
  <version>1.1</version>
  <author>OpenCart Ltd</author>
  <link>http://www.opencart.com</link>
  <file path="system/{engine,library}/{action,loader,config,language}*.php|system/library/template/template.php">
    <operation>
      <search regex="true">
        <![CDATA[~(require|include)(_once)?\(([^)]+)~]]>
      </search>
      <add position="replace">
        <![CDATA[$1$2(modification($3)]]>
      </add>
    </operation>
  </file>
  <file path="system/library/template/twig.php">
    <operation>
      <search>
        <![CDATA[if (is_file($file)) {]]>
      </search>
      <add position="replace">
        <![CDATA[if (defined('DIR_CATALOG') && is_file(DIR_MODIFICATION . 'admin/view/template/' . $filename . '.twig')) {	
                $code = file_get_contents(DIR_MODIFICATION . 'admin/view/template/' . $filename . '.twig');
            } elseif (is_file(DIR_MODIFICATION . 'catalog/view/theme/' . $filename . '.twig')) {
                $code = file_get_contents(DIR_MODIFICATION . 'catalog/view/theme/' . $filename . '.twig');
            } elseif (is_file($file)) {]]>
      </add>
    </operation>
  </file> 
</modification>
Last edited by JNeuhoff on Wed Jul 29, 2020 6:54 pm, edited 1 time in total.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by aleopencart » Sat Jul 25, 2020 11:19 pm

JNeuhoff wrote:
Sat Jul 25, 2020 5:44 pm
aleopencart wrote:
Sat Jul 25, 2020 2:08 am
JNeuhoff wrote:
Fri Jul 24, 2020 9:55 pm
Once you fix the 'modification.xml', our Integrated VQmod should work just fine for OpenCart 3.0.3.5 and 3.0.3.6! I just tested it for OpenCart 3.0.3.6.
Please what's the fix for the modification.xml file that you have tested?
Use this modification.xml:

<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Modification Default</name>
<code>default</code>
<version>1.1</version>
<author>OpenCart Ltd</author>
<link>http://www.opencart.com</link>
<file path="system/{engine,library}/{action,loader,config,language}*.php|system/library/template/template.php">
<operation>
<search regex="true">
<![CDATA[~(require|include)(_once)?\(([^)]+)~]]>
</search>
<add position="replace">
<![CDATA[$1$2(modification($3)]]>
</add>
</operation>
</file>
<file path="system/library/template/twig.php">
<operation>
<search>
<![CDATA[if (is_file($file)) {]]>
</search>
<add position="replace">
<![CDATA[if (defined('DIR_CATALOG') && is_file(DIR_MODIFICATION . 'admin/view/template/' . $filename . '.twig')) {
$code = file_get_contents(DIR_MODIFICATION . 'admin/view/template/' . $filename . '.twig');
} elseif (is_file(DIR_MODIFICATION . 'catalog/view/theme/' . $filename . '.twig')) {
$code = file_get_contents(DIR_MODIFICATION . 'catalog/view/theme/' . $filename . '.twig');
} elseif (is_file($file)) {]]>
</add>
</operation>
</file>
</modification>
Thanks a lot JNeuhoff!!! But I replaced "system/modification.xml" of the 3.0.3.6 release with this and VQMOD still doesn't work with twig files. Php files work well. I don't know. I'm not doing something right.

User avatar
New member

Posts

Joined
Tue Jul 12, 2016 11:57 pm

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by aleopencart » Sun Jul 26, 2020 12:28 am

JNeuhoff wrote:
Sat Jul 25, 2020 11:28 pm
It will work with the Integrated VQMod.
Ahh ok, I thought it also worked with traditional vqmod.
Thank you very much!

User avatar
New member

Posts

Joined
Tue Jul 12, 2016 11:57 pm

Post by trueliar » Wed Jul 29, 2020 1:09 pm

The problem seems to be for both ocmod and vqmod.

I've done a simple Workaround/fix as a ocmod or vqmod.
https://www.opencart.com/index.php?rout ... n_id=39911

If you want to publish your own VQmod (or ocmod) for opencart 3.x (3.0.3.5 3.0.3.6), instead of downloading the previous package, I suggest you to add this code in your own xml file.

Code: Select all

	<file path="system/library/template/twig.php" error="skip" info="fix Core Opencart twig files modification">
		<operation>
			<search><![CDATA[$file = DIR_TEMPLATE . $filename . '.twig';]]></search>
			<add position="replace"><![CDATA[$file = modification( DIR_TEMPLATE . $filename . '.twig' );
			if( class_exists('VQMod') ) {
				$file = \VQMod::modCheck($file);
			}
			]]></add>
		</operation>
	</file>
It will not interfere with other versions of of OC 3.x or the extension if already installed.

New member

Posts

Joined
Sat Jan 11, 2014 12:09 am

Post by aleopencart » Wed Jul 29, 2020 9:50 pm

trueliar wrote:
Wed Jul 29, 2020 1:09 pm
The problem seems to be for both ocmod and vqmod.

I've done a simple Workaround/fix as a ocmod or vqmod.
https://www.opencart.com/index.php?rout ... n_id=39911

If you want to publish your own VQmod (or ocmod) for opencart 3.x (3.0.3.5 3.0.3.6), instead of downloading the previous package, I suggest you to add this code in your own xml file.

Code: Select all

	<file path="system/library/template/twig.php" error="skip" info="fix Core Opencart twig files modification">
		<operation>
			<search><![CDATA[$file = DIR_TEMPLATE . $filename . '.twig';]]></search>
			<add position="replace"><![CDATA[$file = modification( DIR_TEMPLATE . $filename . '.twig' );
			if( class_exists('VQMod') ) {
				$file = \VQMod::modCheck($file);
			}
			]]></add>
		</operation>
	</file>
It will not interfere with other versions of of OC 3.x or the extension if already installed.
Thanks you very much!! Now 3.0.3.5 & 3.0.3.6 versions works fine with VQMOD. I have tested the fix also OCMOD extensions but it doesn't work.

User avatar
New member

Posts

Joined
Tue Jul 12, 2016 11:57 pm

Post by trueliar » Wed Jul 29, 2020 11:52 pm

aleopencart wrote:
Wed Jul 29, 2020 9:50 pm
...
Thanks you very much!! Now 3.0.3.5 & 3.0.3.6 versions works fine with VQMOD. I have tested the fix also OCMOD extensions but it doesn't work.
For the ocmod Make sure to click on update in the Extensions->modification

Check the ocmod logs for errors. The fix is for the twig files, so if the extension is not meant for oc 3.0.3.6 there could probably be a different problem related to the third party extension.

New member

Posts

Joined
Sat Jan 11, 2014 12:09 am

Post by aleopencart » Fri Jul 31, 2020 2:28 pm

trueliar wrote:
Wed Jul 29, 2020 11:52 pm
aleopencart wrote:
Wed Jul 29, 2020 9:50 pm
...
Thanks you very much!! Now 3.0.3.5 & 3.0.3.6 versions works fine with VQMOD. I have tested the fix also OCMOD extensions but it doesn't work.
For the ocmod Make sure to click on update in the Extensions->modification

Check the ocmod logs for errors. The fix is for the twig files, so if the extension is not meant for oc 3.0.3.6 there could probably be a different problem related to the third party extension.

You're right, it works very well in both OCMOD & VQMOD !!
Many Thanks

I ask myself a question was this modification exclusion wanted by the developers? :-\

User avatar
New member

Posts

Joined
Tue Jul 12, 2016 11:57 pm

Post by trueliar » Fri Jul 31, 2020 7:14 pm

aleopencart wrote:
Fri Jul 31, 2020 2:28 pm
You're right, it works very well in both OCMOD & VQMOD !!
Many Thanks

I ask myself a question was this modification exclusion wanted by the developers? :-\
You are welcome!

I suppose that it's not a wanted thing since the ocmod modification system still creates the twig files in the cache but they are not retrieved and showed in the frontend.

New member

Posts

Joined
Sat Jan 11, 2014 12:09 am

Post by aleopencart » Sat Aug 01, 2020 12:51 am

trueliar wrote:
Fri Jul 31, 2020 7:14 pm
aleopencart wrote:
Fri Jul 31, 2020 2:28 pm
You're right, it works very well in both OCMOD & VQMOD !!
Many Thanks

I ask myself a question was this modification exclusion wanted by the developers? :-\
You are welcome!

I suppose that it's not a wanted thing since the ocmod modification system still creates the twig files in the cache but they are not retrieved and showed in the frontend.
Will it be the end of extensions as we see them today ?? ??? :o

User avatar
New member

Posts

Joined
Tue Jul 12, 2016 11:57 pm

Post by JNeuhoff » Sat Aug 01, 2020 1:06 am

aleopencart wrote:
Sat Aug 01, 2020 12:51 am
Will it be the end of extensions as we see them today ?? ??? :o
As I said on this forum thread, modifications of templates still work fine when using our fixed 'system/modification.xml'. And it works for the Integrated VQMod, too.

However, please be aware that the upcoming OpenCart 3.1.x. release has no built-in XML-based modification system at all at the moment.
OpenCart extensions shouldn't have to use OCmod or VQmod. XML is a structured markup language useful for documents and protocols, it's not really meant to be a programming language.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by aleopencart » Sat Aug 01, 2020 3:33 pm

JNeuhoff wrote:
Sat Aug 01, 2020 1:06 am
aleopencart wrote:
Sat Aug 01, 2020 12:51 am
Will it be the end of extensions as we see them today ?? ??? :o
As I said on this forum thread, modifications of templates still work fine when using our fixed 'system/modification.xml'. And it works for the Integrated VQMod, too.

However, please be aware that the upcoming OpenCart 3.1.x. release has no built-in XML-based modification system at all at the moment.
OpenCart extensions shouldn't have to use OCmod or VQmod. XML is a structured markup language useful for documents and protocols, it's not really meant to be a programming language.
Ok, many thanks!

User avatar
New member

Posts

Joined
Tue Jul 12, 2016 11:57 pm

Post by fiveyencoin » Thu Aug 06, 2020 8:32 pm

First of all, I wanted to say THANK YOU to everyone who has commented on this. I am new to OpenCart, and even newer to the world of vq/ocmod. It was quite frustrating when I bought a mod, discovered it needed "vqmod," and was frustrated when I couldn't get it working.

In any case, I was having the same issue: model/controller PHP was being affected by vqmod, but the twig templates were not. Here's a summary of what I did to fix it:
0. Got rid of the "old school" vqmod that I had installed per the extension's instructions, installed Integrated vQMod
1. Made the changes to twig.php as described in this pull: https://github.com/opencart/opencart/pull/8106/files
2. Replaced modification.xml from the maintenance branch here: https://github.com/opencart/opencart/tr ... aintenance
3. Re-enabled Integrated vQMod and things seem to be working great now.

It's been a real headache for the last 4 hours, so again, I appreciate everyone who helped me piece this together finally.

Newbie

Posts

Joined
Thu Aug 06, 2020 6:33 pm

Post by JNeuhoff » Thu Aug 06, 2020 11:21 pm

Glad to hear you got it to work.

As regards:
1. Made the changes to twig.php as described in this pull: https://github.com/opencart/opencart/pull/8106/files
I suggested that solution on github ages ago, it's good to see that it's finally included in the master branch.
The last 2 releases of OpenCart (3.0.3.6 and 3.0.3.5) should not be used in a production environment!

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by xxvirusxx » Fri Aug 07, 2020 2:28 am

JNeuhoff wrote:
Thu Aug 06, 2020 11:21 pm
I suggested that solution on github ages ago, it's good to see that it's finally included in the master branch.
I don't think will be added..

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by IP_CAM » Fri Aug 07, 2020 7:06 am

Who knows, OC was always good for Surprises :laugh:
Whereby, Twig did not lead to, what possibly has been expected, and nobody
ever asked for OcMod, they both only added to formerly unknown problems.
And as long as PHP is used in other parts, it's just a waste of Resources, to make
a (so-called BASIC) Software work, by adding more to it than it really requires.
Especially, as long as it does NOT add to overall performance, which is also not
the case.
From a NON-Coder Point of View at least, something, most OC Users are .... :-\
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by JNeuhoff » Fri Aug 07, 2020 4:20 pm

xxvirusxx wrote:
Fri Aug 07, 2020 2:28 am
JNeuhoff wrote:
Thu Aug 06, 2020 11:21 pm
I suggested that solution on github ages ago, it's good to see that it's finally included in the master branch.
I don't think will be added..
You are right. I think I'll do another pull request on github for this.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by xxvirusxx » Fri Aug 07, 2020 6:44 pm

JNeuhoff wrote:
Fri Aug 07, 2020 4:20 pm
I think I'll do another pull request on github for this.
I think will be ignored because of "restriction". Is like you use PHP but you can't use php include.. :laugh:

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by khnaz35 » Fri Sep 11, 2020 7:39 pm

Hi guys is any one else having issue with OCMOD or VQMOD not working with PHP files on OC 3.0.3.5?

This is my XML file for VQMOD

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
    <id>Advance Settings Editor</id>
    <version>1.0</version>
    <vqmver required="true">2.6.0</vqmver>
    <author>khnaz35</author>
    
    <!-- ADMIN -->
    <!-- Controller -->
    <file name="admin/controller/common/column_left.php">
        <operation error="log">
            <search position="before"><![CDATA[$user = array();]]></search>
            <add><![CDATA[
			if ($this->user->hasPermission('access', 'setting/advance')) {
				$system[] = array(
					'name'	   => $this->language->get('text_setting_advance'),
					'href'     => $this->url->link('setting/advance', 'user_token=' . $this->session->data['user_token'], true),
					'children' => array()		
				);	
			}
]]></add>
        </operation>
	</file>
    
    <!-- Language -->
    <file name="admin/language/*/common/column_left.php">
        <operation error="log">
            <search position="before"><![CDATA[$_['text_other_status']         = 'Other Statuses';]]></search>
            <add><![CDATA[$_['text_setting_advance']         = 'Advance Settings';
]]></add>
        </operation>
	</file>

</modification>
Tried same converted to OCMOD and uploading via Extension=> Installer upload is fine but upon refreshing the modifications theme caches sass etc not sign of change in dashboard.

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia
Who is online

Users browsing this forum: No registered users and 104 guests