Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in admin/controller/extension/modification.php #2633

Closed
mhcwebdesign opened this issue Jan 31, 2015 · 0 comments
Closed

Bug in admin/controller/extension/modification.php #2633

mhcwebdesign opened this issue Jan 31, 2015 · 0 comments

Comments

@mhcwebdesign
Copy link
Collaborator

The following OCMOD xml results in an unexpected 'Not Found' error for OpenCart 2.0.1.1:

.....
<file path="catalog/view/theme/*/template/product/product.tpl">
        <operation>
            <search index="1"><![CDATA[<?php foreach ($options as $option) { ?>]]></search>
            <add position="replace"><![CDATA[blah blah<?php foreach ($options as $option) { ?>]]></add>
        </operation>
    </file>
.....

The corresponding VQMOD xml works as expected:

....
    <file name="catalog/view/theme/*/template/product/product.tpl">
        <operation>
            <search position="replace" index="1"><![CDATA[<?php foreach ($options as $option) { ?>]]></search>
            <add><![CDATA[blah blah<?php foreach ($options as $option) { ?>]]></add>
        </operation>
    </file>
....

Suggested bugfix:
The reason it fails in OCMOD is because of the index-attribute!
The index attribute should be 1-based, as in VQMOD, not zero-based.
In admin/controller/extension/modification.php, the lines around

                                        // Get all the matches
                                        $i = 0;

should be replaced with

                                        // Get all the matches
                                        $i = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants