Navigate back to the homepage

Undefined variable timeMatches and etagMatches cakephp

Infinitbility
Cakephp
September 26th, 2020 · 1 min read
Undefined variable timeMatches and etagMatches cakephp

Hello Friends.

Welcome to Infinitbility!

In this article, we figure out the solution of Undefined variable: timeMatches and etagMatches cakephp.

Crashed Reason

The following code is from Http\Response::checkNotModified. On the compact line, this actually expects that the variables to be compacted actually do exist. This is a poor variable existence check and causes the above notices to be output, which further break the application as it can no longer output headers.

Solution

Change some code on your cakephp package

Step 1

open your Network folder on your cakephp package and edit Response.php

1cd vendor/cakephp/cakephp/src/Network/

Edit Response.php

1sudo vim Response.php

Step 2

Go To line no 1299 or find code like below on your Response.php

1$checks = compact('etagMatches', 'timeMatches');
2if (empty($checks)) {
3 return false;
4}

Replace with below code

1if (!isset($etagMatches, $timeMatches)) {
2 return false;
3}
4$checks = compact('etagMatches', 'timeMatches')

if you get help, please share post on your social network

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.

More articles from Infinitbility

App crashed immediately after install react native video or track player

App crashed immediately after install react native video or track player

In this article, we figure out the solution of the conflict issues of video and track players.

September 22nd, 2020 · 1 min read
React Native Font Family list

React Native Font Family list

In this article, we discuss about react native fonts, fonts list, custom fonts, and fonts ttf files.

September 16th, 2020 · 1 min read
© 2020–2021 Infinitbility
Disclaimer
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]