Zend Framework action called twice

we are trying to create an application using the zend structure and have the following problem: "Some actions of the controller are called twice. This means that the actions are called, its execution ends, and then they are called again."

We tracked this by checking the entries in the log file. For one request, there are 2 entries in the log file.

Do you know anything that might cause this problem? Is this related to the sending process of Front Controller?

Hi,

+6
php zend-framework
source share
6 answers

I found out that the action was requested twice when the Chrome Extension Webug (FirePHP extension for Google Chrome) was turned on.

+5
source share

direct or stack action may be the cause

+2
source share

try using a debugger (e.g. XDebug) to find out how your code is executing. focus on the dispatcher, something was about to happen, and the request action is not set as sent, so it starts again.

+2
source share

It could be a mistake. It is hard to say without additional information.

Try registering a back trace every time an action method is called.

<?php trigger_error(var_export(debug_backtrace(), true)); trigger_error(var_export($_SERVER, true)); ?> 

This will give you a ton of information in the error log, so you will want to export the result to a text editor and read it there. And / or maybe change the code to print less information.

A few things to look for:

  • Is the action method called from different places?
  • Differences between $ _SERVER ['UNIQUE_ID'] (or REQUEST_TIME)?

If the unique identifier is different from the other, you made two requests to the server. If not, try to figure it out from the return line.

+1
source share

We had a similar problem. Some actions were performed twice. After much debugging and searching on Google, it turned out that the problem was a bug in ZFdebug. This patch was installed, and everything became normal. Hope this helps someone else.

+1
source share

I am using Chrome 17.0.x, Webug and Zend Framework 1.11.1 and still see this problem. I disabled Webug as suggested, and the action was called only once.

So, I think this is a bug in Webug.

+1
source share

All Articles