Page 1 of 1
Parse error
Posted: Wed Mar 09, 2016 12:18 pm
by fiveam
I get this error when I click on address book. Everything else seems to be working perfectly.
Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ')' in catalog/controller/account/address.php on line 522
Has anyone else ran into this problem with 2.2.0.0?
Re: Parse error
Posted: Thu Mar 10, 2016 6:21 pm
by pm-netti
fiveam wrote:I get this error when I click on address book. Everything else seems to be working perfectly.
Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ')' in catalog/controller/account/address.php on line 522
Has anyone else ran into this problem with 2.2.0.0?
That line 522 check custom field settings:
Code: Select all
foreach ($custom_fields as $custom_field) {
if (($custom_field['location'] == 'address') && $custom_field['required'] && empty($this->request->post['custom_field'][$custom_field['custom_field_id']])) {
$this->error['custom_field'][$custom_field['custom_field_id']] = sprintf($this->language->get('error_custom_field'), $custom_field['name']);
} elseif (($custom_field['type'] == 'text' && !empty($custom_field['validation'] && $custom_field['location'] == 'address')) && !filter_var($this->request->post['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) {
$this->error['custom_field'][$custom_field['custom_field_id']] = sprintf($this->language->get('error_custom_field_validate'), $custom_field['name']);
}
}
Is that bug (in line 522):
Code: Select all
&& !empty($custom_field['validation'] && $custom_field['location'] == 'address'))
you try change to:
Code: Select all
&& !empty($custom_field['validation']) && $custom_field['location'] == 'address'))
Re: Parse error
Posted: Mon Mar 14, 2016 6:27 pm
by fiveam
I tried that change and still get the same exact error.
The error happens whether logged in or not.
Re: Parse error
Posted: Mon Mar 14, 2016 7:42 pm
by pm-netti
fiveam wrote:I tried that change and still get the same exact error.
The error happens whether logged in or not.
This new test, line 522:
Code: Select all
&& !empty($custom_field['validation'] && $custom_field['location'] == 'address'))
you try change to:
Code: Select all
&& !empty($custom_field['validation']) && $custom_field['location'] == 'address')
Re: Parse error
Posted: Mon Mar 14, 2016 11:39 pm
by Randem
I have seen the same exact code in customer.php and here is the solution for that -
http://forum.opencart.com/viewtopic.php?f=191&t=159399
Re: Parse error
Posted: Fri Mar 18, 2016 1:24 am
by bhraqnet
This new test, line 522:
Code: Select all
} elseif (($custom_field['type'] == 'text' && !empty($custom_field['validation'] && $custom_field['location'] == 'address')) && !filter_var($this->request->post['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) {
Code: Select all
you try change to:
} elseif (($custom_field['type'] == 'text' && !empty($custom_field['validation']) && $custom_field['location'] == 'address') && !filter_var($this->request->post['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) {
look here
https://github.com/waqasjawed/opencart/ ... a96e215bd9
Re: Parse error
Posted: Tue Mar 29, 2016 11:14 pm
by williamhazel
Confirmed. Replacing line 522 with:
Code: Select all
} elseif (($custom_field['type'] == 'text' && !empty($custom_field['validation']) && $custom_field['location'] == 'address') && !filter_var($this->request->post['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) {
fixes the issue in OC 2.2.
Re: Parse error
Posted: Wed May 18, 2016 3:02 am
by beebee
williamhazel wrote:Confirmed. Replacing line 522 with:
Code: Select all
} elseif (($custom_field['type'] == 'text' && !empty($custom_field['validation']) && $custom_field['location'] == 'address') && !filter_var($this->request->post['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) {
fixes the issue in OC 2.2.
Hello,
I just came across this error and tried the steps after going through the thread, but the issue persists. I still get the below when I click on Address Book on the website:
Parse error: syntax error, unexpected '&&' (T_BOOLEAN_AND), expecting ')' in /home/blingssf/public_html/DBTEST/catalog/controller/account/address.php on line 522
Am I missing something?? Please help!!
Thanks!
Re: Parse error
Posted: Wed May 18, 2016 3:10 am
by beebee
beebee wrote:williamhazel wrote:Confirmed. Replacing line 522 with:
Code: Select all
} elseif (($custom_field['type'] == 'text' && !empty($custom_field['validation']) && $custom_field['location'] == 'address') && !filter_var($this->request->post['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) {
fixes the issue in OC 2.2.
Hello,
I just came across this error and tried the steps after going through the thread, but the issue persists. I still get the below when I click on Address Book on the website:
Parse error: syntax error, unexpected '&&' (T_BOOLEAN_AND), expecting ')' in /home/blingssf/public_html/DBTEST/catalog/controller/account/address.php on line 522
Am I missing something?? Please help!!
Thanks!
-----------------------------
I don't know what happened, but after a few more tries it worked. Thanks peeps!
Re: Parse error
Posted: Thu Jul 28, 2016 5:30 am
by MJDOS
In Panel Admin enter:
Extensions> Modifications
And click the Update button OpenCart will rebuild the cache changes .
Doing this will work.