Reputation: 9782
I have the following code:
if (isset($this->request->get['filter'])) {
$filter = $this->request->get['filter'];
} else {
$filter = '';
}
I want to replace it with:
if (isset($this->request->get['attribute'])) {
$filter = $this->request->get['attribute'];
} else {
$filter = '';
}
I have tried the following in vQmod folder:
<operation info="After filter request, add attribute request">
<search position="Replace"><![CDATA[
if (isset($this->request->get['filter'])) {
]]></search>
<add><![CDATA[
if (isset($this->request->get['attribute'])) {
$filter = $this->request->get['attribute'];
}
]]></add>
</operation>
I checked the vQmod log files and am getting the error: SEARCH NOT FOUND
Can anyone help me to tell me what I have to use in if
statement replacement.
Upvotes: 0
Views: 507
Reputation: 15151
The easiest solution would be just to replace both of the get['filter']
values like so
<operation>
<search position="replace"><[CDATA[get['filter']]]></search>
<add><[CDATA[get['attribute']]]></add>
</operation>
Upvotes: 1
Reputation: 9782
i tried to use offset
into my search attribute like <search position="Replace" offset="2">
but it produce some other error so i decide to use single line search like the following :
<operation>
<search position="replace"><![CDATA[
if (isset($this->request->get['filter'])) {
]]></search>
<add><![CDATA[
if (isset($this->request->get['attribute'])) {
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[
$filter = $this->request->get['filter'];
]]></search>
<add><![CDATA[
$filter = $this->request->get['attribute'];
]]></add>
</operation>
Hope it helps someone else like me
Upvotes: 0