I tested the alpha version, reported this problem and it is still actual in the 2.0.0.0 release! Guys, if you offer the modification functionality then make it right. At the present time it is completely unsuitable for serious changes. It does not support indexes, it does not work with lines (like vqmod does). Actually, it is just a simple substring replace call People recommend to forget about modifications and install vqmod instead! Are you sure that this was your original plan? Why did someone spend time on this functionality if it is worth almost nothing right now?... If you have any license issues with vqmod integration then perhaps you should purchase this source code.
Please let us know your plans about the modifications and if there will be any improvements soon.
But OCMod is what we have. I'm not sure what other devs think about it. I'm definitely feeling between a rock and a hard place. It's either wait for OCMod to get whipped into shape who knows when or upgrade existing vQmods and deal with the problems of having several different modding systems later.
-Ryan
this is one that some one posted to fix white space issues.
example:
https://github.com/opencart/opencart/co ... d97dae5184
OpenCart®
Project Owner & Developer.
https://github.com/opencart/opencart/issues/1967
As soon as they fix it, it should work better although I would still miss inserting the code below/above lines.
there is no index functionality its called offset because its where the occurrences of the matched elements shoudl start to replace.karapuz wrote:I found out that there is an index functionality in ocmod but it does not work because of a bug. Here is a ticket mentioning this issue:
https://github.com/opencart/opencart/issues/1967
As soon as they fix it, it should work better although I would still miss inserting the code below/above lines.
OpenCart®
Project Owner & Developer.
index and trim attributes on the search element.
position and offset are set on the add element.
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Multiple Search Match Test</name>
<version>1.0</version>
<author>OpenCart Ltd</author>
<link>http://www.opencart.com</link>
<file path="catalog/controller/common/home.php">
<operation>
<search><![CDATA[$data['column_left'] = $this->load->controller('common/column_left');]]></search>
<add position="before"><![CDATA[
/* test123 */
]]></add>
</operation>
</file>
</modification>
OpenCart®
Project Owner & Developer.
Thank you for the update! It almost works as needed, but I have two notices after testing:Daniel wrote:try testing the latest master version please.
1) in admin/controller/extension/modification.php the following line
if (trim($search) == $line) {
should be replaced with something like this:
if (stripos($line, $search) !== false) {
Because no one specifies the whole line for matching. The line should be identified by the substring in the 'search'.
2) Ocmod indexes start with 0, the default vqmod starts indexes with 1. It not a big deal of course, but if you could make it identical then perhaps it would be better.
Thank you again.
We have had a complete VQmod-XML support available for the admin/controller/extension/modification.php for quite a while now, please feel free to use it. It can co-exist with the OCmod-XML.Daniel wrote:then help me build one closer to vqmod. we just need the functionality that is used the most. not the full featured version.
this is one that some one posted to fix white space issues.
example:
https://github.com/opencart/opencart/co ... d97dae5184
BTW.: I have yet to see some more documentation for e.g. the OCmod's offset, limit and index(is the latter still there?) attritbutes, how are they supposed to work with a single whole string buffer, as opposed to VQmod's array of lines?
Attachments
VQmod-XML support for the OpenCart 2.0.0.1b modification system
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
The bottom line is: We need line-based features as is the case with the VQmod-XML and its attributes.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
That looks much better already. Looking at the code, it now seems to be fully lines-based, and supports the trim and index attributes for the add-node, as well as the position and offset attributes for the add-node. So it's becoming more VQmod-alike finally.karapuz wrote:2JNeuhoff: After the latest update OC2 introduces the line-based additions like vqmod does. Check the latest modification.php file from the github.
Of course, our VQmod-XML addon for the Opencart modification already has it all
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Well, I assume same specs, but not the same VQmod-XML syntax?Daniel wrote:sack it going to make it the same spec as vqmod
Anyway, your OCmod looks much better now, because it is finally using an array of lines instead of a whole stringbuffer to operate on. There is still a bug which I posted on github.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
this is not how vqmod works! this is a feature you want!
you should indent yourself.
The search should match the search expression on the line, and then just replace the match with the subsituted data. It should not do anything else, like removing leading whitespaces on the matched line. Only the matched search expression, or the subsituted data from the add-node text should be allowed to be trimmed, depending on the 'trim' attributes. See https://github.com/vqmod/vqmod/wiki/Scripting on how vqmod does it! I just tested it with QPhoria's latest VQmod 2.5.1 and my own VQmod 2.4.1 on OpenCart 2.0.0.1b.
If we want VQmod features, with just using a different OCmod XML syntax, then your current code is wrong. If you like, I can easily implement your planned OCmod XML syntax, I already have VQmod-XML anyway, the main change would only be the relocation of the 'position' and 'offset' attributes from the 'search' node to the 'add' node, and some other minor changes ('name' instead of 'id', or introducing the 'code' and 'link' nodes that didn't exist in VQmod, or removing the vqmver node etc).
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Users browsing this forum: No registered users and 30 guests