Skip Navigation

[Resolved] Website shows a critical error since toolset update

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 10 replies, has 2 voices.

Last updated by helenK 1 year, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2543927
Messed up company-publications.png

Tell us what you are trying to do?
I've updated Toolset after renew subscription, and then the website shows a critical error.

I expected to see:
The link should work without show up the link (Not yet upgrade)
hidden link
hidden link
hidden link
hidden link
hidden link
hidden link
hidden link
hidden link
hidden link

Link to a page where the issue can be seen:
hidden link
hidden link
hidden link
hidden link
hidden link
hidden link
hidden link
hidden link
hidden link

The different of 2 sites is Toolset Module Manager:
hidden link is 1.86
somerleycapital.testmeifyoucan.com is 1.88

#2543993

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I'll have to check what is the critical error and what is causing the issue.

Please share problem URL and admin access details.

Can you please share debug log and share with me or share admin access details:
=> https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#php-debugging

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

#2544011

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I will require FTP access details in order to have access of your files.

Can you please send me FTP access details.

I have set the next reply to private which means only you and I have access to it.

#2544013

The hosting didn't provide. We don't use FTP at all. We identity the latest toolsets didn't support URL rewrite

#2544017

The original URL (rewrite URL) without Y parameter will lost layout after upgrade:

2023/01/30 07:50:17 [error] 62356#62356: *12710 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined array key "Y" in /www/somerley_974/public/wp-content/themes/somerley/templates/corporate-governance.php on line 4PHP message: PHP Warning:  Undefined array key 2019 in /www/somerley_974/public/wp-content/themes/somerley/templates/corporate-governance.php on line 54PHP message: PHP Warning:  Undefined array key 2018 in /www/somerley_974/public/wp-content/themes/somerley/templates/corporate-governance.php on line 54PHP message: PHP Warning:  Undefined array key 2017 in /www/somerley_974/public/wp-content/themes/somerley/templates/corporate-governance.php on line 54PHP message: PHP Fatal error:  Uncaught TypeError: mktime(): Argument #6 ($year) must be of type ?int, string given in /www/somerley_974/public/wp-includes/class-wp-date-query.php:320
Stack trace:
#0 /www/somerley_974/public/wp-includes/class-wp-date-query.php(320): mktime(0, 0, 0, 12, 31, 'All')
#1 /www/somerley_974/public/wp-includes/class-wp-date-query.php(220): WP_Date_Query->validate_date_values(Array)
#2 /www/somerley_974/public/wp-includes/class-wp-date-query.php(232): WP_Date_Query->sanitize_query(Array, Array)
#3 /www/somerley_974/public/wp-includes/class-wp-date-query.php(174): WP_Date_Query->sanitize_query(Array)
#4 /www/somerley_974/public/wp-includes/class-wp-query.php(2057): WP_Date_Query->__construct(Array)
#5 /www/somerley_974/public/wp-includes/class-wp-query.php(3749): WP_Query->get_posts()
#6 /www/somerley_974/public/wp-includes/class-wp-query.php(3881): WP_Query->query(Array)
#7 /www/somerley_974/public/wp-content/themes/somerley/templates/corporate-governance.php(72): WP_Query" while reading response header from upstream, client: 218.103.59.105, server: somerleycapital.testmeifyoucan.com, request: "GET /en/corporate-governance/ HTTP/1.1", upstream: "hidden link:", host: "somerleycapital.testmeifyoucan.com:38077", referrer: "hidden link"

Here is the example:
Upgraded and added y parameter manually
hidden link

Original link without error before upgrade
hidden link

#2544053

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Based on the error log you shared with me, I can clearly see the following Fatal error:

 PHP Fatal error:  Uncaught TypeError: mktime(): Argument #6 ($year) must be of type ?int, string given in /www/somerley_974/public/wp-includes/class-wp-date-query.php:320
Stack trace:
#0 /www/somerley_974/public/wp-includes/class-wp-date-query.php(320): mktime(0, 0, 0, 12, 31, 'All')
#1 /www/somerley_974/public/wp-includes/class-wp-date-query.php(220): WP_Date_Query->validate_date_values(Array)
#2 /www/somerley_974/public/wp-includes/class-wp-date-query.php(232): WP_Date_Query->sanitize_query(Array, Array)
#3 /www/somerley_974/public/wp-includes/class-wp-date-query.php(174): WP_Date_Query->sanitize_query(Array)
#4 /www/somerley_974/public/wp-includes/class-wp-query.php(2057): WP_Date_Query->__construct(Array)
#5 /www/somerley_974/public/wp-includes/class-wp-query.php(3749): WP_Query->get_posts()
#6 /www/somerley_974/public/wp-includes/class-wp-query.php(3881): WP_Query->query(Array)
#7 /www/somerley_974/public/wp-content/themes/somerley/templates/corporate-governance.php(72):

The error is from your theme file: wp-content/themes/somerley/templates/corporate-governance.php(72):

Can you please fix that and check if that help you to resolve your issue.

#2544665

I found that the code if querying the custom post but it didn't change for years, it works fine until this update.

This is the code segments related:

$custom_post_type = 'corp-gov-post';
if ($_GET["Y"] != null){
$filter_year = $_GET["Y"];
}
else{
$filter_year = "All";
}

$paging = array(
'post_type' => $custom_post_type,
'paged' => $paged, //Pagination [CR83]
'posts_per_page' => 20, //Pagination [CR83]
'date_query' => array(
'column' => 'publish-date',
array(
'year' => $filter_year,
),
),
);

Line 72: $paging_object = new WP_Query($paging);

#2544867

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The code you added didnt changed for years but the PHP version does and we will have to react accordingly.

what if you try to use the following modified code and check if that help you to resolve your issue:

$date_query_args = array();
$custom_post_type = 'corp-gov-post';

if ($_GET["Y"] != null){

$filter_year = $_GET["Y"];
$date_query_args = array(
'column' => 'publish-date',
array(
'year' => $filter_year,
),
);

}
else{
$filter_year = "All";
}

$paging = array(
'post_type' => $custom_post_type,
'paged' => $paged, //Pagination [CR83]
'posts_per_page' => 20, //Pagination [CR83]
'date_query' => $date_query_args 
);

Does the above modified code works for you?

#2546035

Thanks for the modified code, I'm modifying it to fit the page, if there are any issues I will get back to you.

#2546151

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Sure - if you find the solution I shared help you to resolve your issue - You're welcome to mark resolve this ticket.

#2546179

My issue is resolved now. Thank you!