Post by fiveam » Wed Mar 09, 2016 12:18 pm

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?

Newbie

Posts

Joined
Tue Mar 08, 2016 4:31 am

Post by pm-netti » Thu Mar 10, 2016 6:21 pm

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'))

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by fiveam » Mon Mar 14, 2016 6:27 pm

I tried that change and still get the same exact error.

The error happens whether logged in or not.

Newbie

Posts

Joined
Tue Mar 08, 2016 4:31 am

Post by pm-netti » Mon Mar 14, 2016 7:42 pm

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')

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by Randem » Mon Mar 14, 2016 11:39 pm

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

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by bhraqnet » Fri Mar 18, 2016 1:24 am

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

Active Member

Posts

Joined
Thu Dec 26, 2013 11:16 pm

Post by williamhazel » Tue Mar 29, 2016 11:14 pm

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.

Newbie

Posts

Joined
Tue Mar 29, 2016 12:57 pm

Post by beebee » Wed May 18, 2016 3:02 am

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!

BeeBee
When the going gets weird, the weird turn Pro!!


User avatar
New member

Posts

Joined
Thu May 12, 2016 5:13 pm

Post by beebee » Wed May 18, 2016 3:10 am

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!

BeeBee
When the going gets weird, the weird turn Pro!!


User avatar
New member

Posts

Joined
Thu May 12, 2016 5:13 pm

Post by MJDOS » Thu Jul 28, 2016 5:30 am

In Panel Admin enter:

Extensions> Modifications

And click the Update button OpenCart will rebuild the cache changes .

Doing this will work.

Newbie

Posts

Joined
Thu Jul 28, 2016 5:27 am
Who is online

Users browsing this forum: No registered users and 6 guests