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...IP_CAM wrote: ↑Sat Jul 25, 2020 2:52 amJNeuhoff'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
Use this modification.xml:aleopencart wrote: ↑Sat Jul 25, 2020 2:08 amPlease what's the fix for the modification.xml file that you have tested?
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>
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
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.JNeuhoff wrote: ↑Sat Jul 25, 2020 5:44 pmUse this modification.xml:aleopencart wrote: ↑Sat Jul 25, 2020 2:08 amPlease what's the fix for the modification.xml file that you have tested?
<?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>
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
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>
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.trueliar wrote: ↑Wed Jul 29, 2020 1:09 pmThe 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.
It will not interfere with other versions of of OC 3.x or the extension if already installed.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>
For the ocmod Make sure to click on update in the Extensions->modificationaleopencart 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.
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.
trueliar wrote: ↑Wed Jul 29, 2020 11:52 pmFor the ocmod Make sure to click on update in the Extensions->modificationaleopencart 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.
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?
You are welcome!aleopencart wrote: ↑Fri Jul 31, 2020 2:28 pmYou'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?
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 ??trueliar wrote: ↑Fri Jul 31, 2020 7:14 pmYou are welcome!aleopencart wrote: ↑Fri Jul 31, 2020 2:28 pmYou'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?
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.
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.aleopencart wrote: ↑Sat Aug 01, 2020 12:51 amWill it be the end of extensions as we see them today ??
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
Ok, many thanks!JNeuhoff wrote: ↑Sat Aug 01, 2020 1:06 amAs 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.aleopencart wrote: ↑Sat Aug 01, 2020 12:51 amWill it be the end of extensions as we see them today ??
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.
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.
As regards:
I suggested that solution on github ages ago, it's good to see that it's finally included in the master branch.1. Made the changes to twig.php as described in this pull: https://github.com/opencart/opencart/pull/8106/files
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
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
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.
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
I think will be ignored because of "restriction". Is like you use PHP but you can't use php include..
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
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>
Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature
Users browsing this forum: No registered users and 101 guests