Development

#2076 (inclusion of single javascript function call with an underscore in the name causes action stack to execute twice)

You must first sign up to be able to contribute.

Ticket #2076 (new defect)

Opened 1 year ago

Last modified 1 year ago

inclusion of single javascript function call with an underscore in the name causes action stack to execute twice

Reported by: z01d Assigned to: fabien
Priority: major Milestone:
Component: view Version: 1.0.5
Keywords: layout, javascript, underscore, double execution Cc: evgeniy.fedorov@gmail.com
Qualification:

Description

Tested on 1.05 and 1.06.

If you put in the application layout template there is a single line of javascript with an underscore...:

layout.php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<?php include_http_metas() ?>
<?php include_metas() ?>

<?php include_title() ?>

<link rel="shortcut icon" href="/favicon.ico" />

</head>
<body>

<?php echo $sf_data->getRaw('sf_content') ?>

<script type="text/javascript">
do_something();
</script>

</body>
</html>

... the action stack is being called twice:

frontend_dev.log

Aug 05 08:03:11 symfony [info] {sfContext} initialization
Aug 05 08:03:11 symfony [info] {sfController} initialization
Aug 05 08:03:11 symfony [info] {sfRouting} match route [default_index] "/:module"
Aug 05 08:03:11 symfony [info] {sfRequest} request parameters array (  'module' => 'test',  'action' => 'index',)
Aug 05 08:03:11 symfony [info] {sfController} dispatch request
Aug 05 08:03:11 symfony [info] {sfFilter} executing filter "sfRenderingFilter"
Aug 05 08:03:11 symfony [info] {sfFilter} executing filter "sfWebDebugFilter"
Aug 05 08:03:11 symfony [info] {sfFilter} executing filter "sfCommonFilter"
Aug 05 08:03:11 symfony [info] {sfFilter} executing filter "sfFlashFilter"
Aug 05 08:03:11 symfony [info] {sfFilter} executing filter "sfExecutionFilter"
Aug 05 08:03:11 symfony [info] {sfAction} call "testActions->executeIndex()"
Aug 05 08:03:11 symfony [info] {sfView} initialize view for "test/index"
Aug 05 08:03:11 symfony [info] {sfView} render "z:\home\test2\www\apps\frontend\modules/test/templates/indexSuccess.php"
Aug 05 08:03:11 symfony [info] {sfView} decorate content with "z:\home\test2\www\apps\frontend\templates/layout.php"
Aug 05 08:03:11 symfony [info] {sfView} render "z:\home\test2\www\apps\frontend\templates/layout.php"
Aug 05 08:03:11 symfony [info] {sfFilter} render to client
Aug 05 08:03:11 symfony [info] {sfResponse} send status "HTTP/1.0 200 OK"
Aug 05 08:03:11 symfony [info] {sfResponse} send header "Content-Type": "text/html; charset=utf-8"
Aug 05 08:03:11 symfony [info] {sfResponse} send content (18765 o)
Aug 05 08:03:11 symfony [info] {sfTimerManager} Configuration 28.72 ms (11)
Aug 05 08:03:11 symfony [info] {sfTimerManager} Action "test/index" 0.15 ms (1)
Aug 05 08:03:11 symfony [info] {sfTimerManager} View "Success" for "test/index" 35.09 ms (1)
Aug 05 08:03:11 symfony [info] {sfContext} initialization
Aug 05 08:03:11 symfony [info] {sfController} initialization
Aug 05 08:03:11 symfony [info] {sfRouting} match route [default_index] "/:module"
Aug 05 08:03:11 symfony [info] {sfRequest} request parameters array (  'module' => 'test',  'action' => 'index',)
Aug 05 08:03:11 symfony [info] {sfController} dispatch request
Aug 05 08:03:11 symfony [info] {sfFilter} executing filter "sfRenderingFilter"
Aug 05 08:03:11 symfony [info] {sfFilter} executing filter "sfWebDebugFilter"
Aug 05 08:03:11 symfony [info] {sfFilter} executing filter "sfCommonFilter"
Aug 05 08:03:11 symfony [info] {sfFilter} executing filter "sfFlashFilter"
Aug 05 08:03:11 symfony [info] {sfFilter} executing filter "sfExecutionFilter"
Aug 05 08:03:11 symfony [info] {sfAction} call "testActions->executeIndex()"
Aug 05 08:03:11 symfony [info] {sfView} initialize view for "test/index"
Aug 05 08:03:11 symfony [info] {sfView} render "z:\home\test2\www\apps\frontend\modules/test/templates/indexSuccess.php"
Aug 05 08:03:12 symfony [info] {sfView} decorate content with "z:\home\test2\www\apps\frontend\templates/layout.php"
Aug 05 08:03:12 symfony [info] {sfView} render "z:\home\test2\www\apps\frontend\templates/layout.php"
Aug 05 08:03:12 symfony [info] {sfFilter} render to client
Aug 05 08:03:12 symfony [info] {sfResponse} send status "HTTP/1.0 200 OK"
Aug 05 08:03:12 symfony [info] {sfResponse} send header "Content-Type": "text/html; charset=utf-8"
Aug 05 08:03:12 symfony [info] {sfResponse} send content (18765 o)
Aug 05 08:03:12 symfony [info] {sfTimerManager} Configuration 24.58 ms (11)
Aug 05 08:03:12 symfony [info] {sfTimerManager} Action "test/index" 0.15 ms (1)
Aug 05 08:03:12 symfony [info] {sfTimerManager} View "Success" for "test/index" 52.94 ms (1)

I used an empty project and module to reproduce this behavior.
NOTE: If the javascript function with an underscore is preceded or followed by other lines in the script insert, there is no error.
I noticed this when every insert query in db was doubled.

Change History

08/28/07 19:17:40 changed by fabien

  • milestone deleted.