Error on Login
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Error on Login
Hi;
Version 1.1.0.4
When a customer is logging in I am getting this funny error-
Warning: array_filter() expects parameter 1 to be array, null given in /xx/xx/includes/system/versioned/1.0.5.1/customer.php on line 52
I checked database though fields are not filled in customer and address book but there is no wrong value in any column, only the defaults for the ones that are empty.
Any fix pls.. When I googled it says null check is required but cannot figure out where to begin as it is a core file.
Thank you for help in advance;
Warm Regds./
radhavallabh
Version 1.1.0.4
When a customer is logging in I am getting this funny error-
Warning: array_filter() expects parameter 1 to be array, null given in /xx/xx/includes/system/versioned/1.0.5.1/customer.php on line 52
I checked database though fields are not filled in customer and address book but there is no wrong value in any column, only the defaults for the ones that are empty.
Any fix pls.. When I googled it says null check is required but cannot figure out where to begin as it is a core file.
Thank you for help in advance;
Warm Regds./
radhavallabh
- burt
- Core Team
- Posts: 4550
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Error on Login
This for all customers?
Just one customer?
Can you rewrite this:
> I checked database though fields are not filled in customer and address book but there is no wrong value in any column, only the defaults for the ones that are empty.
As I can't understand if you have customer fields or if they are blank.
Just one customer?
Can you rewrite this:
> I checked database though fields are not filled in customer and address book but there is no wrong value in any column, only the defaults for the ones that are empty.
As I can't understand if you have customer fields or if they are blank.
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Re: Error on Login
Hi;burt wrote: ↑Sun Aug 03, 2025 1:35 pm This for all customers?
Just one customer?
Can you rewrite this:
> I checked database though fields are not filled in customer and address book but there is no wrong value in any column, only the defaults for the ones that are empty.
As I can't understand if you have customer fields or if they are blank.
I elaborate as below-
I have the fields but some are blank or have default value.
This for some customers specially those through Paypal and Old ones from previous database-
Have attached the pics from sql, some have partial empty fields in customer table and I attach example of address book customers missing state field for example.
Thank you in advance;
Warm Regds./
radhavallabh
You do not have the required permissions to view the files attached to this post.
- burt
- Core Team
- Posts: 4550
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Error on Login
All customers?
One customer?
One customer?
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Re: Error on Login
Not all-Those with all filled fields are logging in correctly. Only those from Paypal Login and Those with some missing fields like state in address book or telephone from customers table.
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Error on Login
It's telling you that some of your customers have no valid default address. If you go through the database and set the customers_default_address_id (on the customers table) to one of the addresses in the address_book for that customer, it should fix it.
Start withthen then That will tell you which customers have the problem.
For each of those, you can doand add the customer ID at the end. That will tell you what addresses they have available. If you do this in another window, you can update the customers_default_address_id directly in the search results from the previous queries.
If you want to try to hack around it, you can change line 52 of fromto which will at least quiet that error.
The reason why core does not do that is that that error is telling you that something is wrong with the customers_default_address_id. It would be better to fix that problem, as it will cascade out to other problems.
Start with
Code: Select all
SELECT customers_id, customers_default_address_id FROM customers WHERE customers_default_address_id = 0Code: Select all
SELECT customers_id, customers_default_address_id FROM customers WHERE customers_default_address_id IS NULLCode: Select all
SELECT c.customers_id, c.customers_default_address_id FROM customers c LEFT JOIN address_book ab ON c.customers_id = ab.customers_id AND c.customers_default_address_id = ab.address_book_id WHERE ab.address_book_id IS NULLFor each of those, you can do
Code: Select all
SELECT * FROM address_book WHERE customers_id = If you want to try to hack around it, you can change line 52 of from
Code: Select all
$this->data[$to] = array_filter($address_query->fetch_assoc(), function ($v) { return !Text::is_empty($v); });Code: Select all
$this->data[$to] = array_filter($address_query->fetch_assoc() ?? [], function ($v) { return !Text::is_empty($v); });The reason why core does not do that is that that error is telling you that something is wrong with the customers_default_address_id. It would be better to fix that problem, as it will cascade out to other problems.
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Re: Error on Login
Thank you so much dear;ecartz wrote: ↑Sun Aug 03, 2025 3:12 pm It's telling you that some of your customers have no valid default address. If you go through the database and set the customers_default_address_id (on the customers table) to one of the addresses in the address_book for that customer, it should fix it.
Start withthenCode: Select all
SELECT customers_id, customers_default_address_id FROM customers WHERE customers_default_address_id = 0thenCode: Select all
SELECT customers_id, customers_default_address_id FROM customers WHERE customers_default_address_id IS NULLThat will tell you which customers have the problem.Code: Select all
SELECT c.customers_id, c.customers_default_address_id FROM customers c LEFT JOIN address_book ab ON c.customers_id = ab.customers_id AND c.customers_default_address_id = ab.address_book_id WHERE ab.address_book_id IS NULL
For each of those, you can doand add the customer ID at the end. That will tell you what addresses they have available. If you do this in another window, you can update the customers_default_address_id directly in the search results from the previous queries.Code: Select all
SELECT * FROM address_book WHERE customers_id =
If you want to try to hack around it, you can change line 52 of fromtoCode: Select all
$this->data[$to] = array_filter($address_query->fetch_assoc(), function ($v) { return !Text::is_empty($v); });which will at least quiet that error.Code: Select all
$this->data[$to] = array_filter($address_query->fetch_assoc() ?? [], function ($v) { return !Text::is_empty($v); });
The reason why core does not do that is that that error is telling you that something is wrong with the customers_default_address_id. It would be better to fix that problem, as it will cascade out to other problems.
Fixing this problem right away...
Very Warm Regds,./
radhavallabh