Navigate back to the homepage

Undefined variable timeMatches and etagMatches cakephp

September 26th, 2020 · 1 min read

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.


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;

Replace with below code

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

Thanks for reading…

Follow me on Twitter

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.

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]

Guide book

Guidebook: The Javascript Monorepo Photoshop Guide



More articles from Infinitbility

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

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

September 16th, 2020 · 2 min read
© 2020–2022 Infinitbility
Link to $ to $ to $ to $ to $ to $mailto:[email protected]