Development

#899 (FATAL ERROR when using helper from action (with symfony-alpha))

You must first sign up to be able to contribute.

Ticket #899 (closed defect: invalid)

Opened 3 years ago

Last modified 3 years ago

FATAL ERROR when using helper from action (with symfony-alpha)

Reported by: brikou Assigned to:
Priority: blocker Milestone:
Component: Version: 0.7.X
Keywords: Cc:
Qualification:

Description

when using helper from an action I get a fatal error (it used to work with symfony-beta but not with symfony-alpha). My symfony version is "version 0.9.2016" (the latest)

in the action

//...
include_once ('symfony/helper/HelperHelper.php');
use_helper('Text');
$this->test = truncate_text ($text, $length = 100, $truncate_string = '...', $truncate_lastspace = false);
//...

the error

Fatal error: Cannot redeclare use_helpers() in D:\xampplite\php\pear\symfony\helper\HelperHelper.php on line 23
Call Stack
#	Function	Location
1	{main}()	D:\xampplite\www\sandbox\web\frontend_dev.php:0
2	sfFrontWebController->dispatch()	D:\xampplite\www\sandbox\web\frontend_dev.php:10
3	sfController->forward()	D:\xampplite\php\pear\symfony\controller\sfFrontWebController.class.php:48
4	sfFilterChain->execute()	D:\xampplite\php\pear\symfony\controller\sfController.class.php:339
5	sfWebDebugFilter->execute()	D:\xampplite\php\pear\symfony\filter\sfFilterChain.class.php:76
6	sfFilterChain->execute()	D:\xampplite\php\pear\symfony\filter\sfWebDebugFilter.class.php:37
7	sfCommonFilter->execute()	D:\xampplite\php\pear\symfony\filter\sfFilterChain.class.php:76
8	sfFilterChain->execute()	D:\xampplite\php\pear\symfony\filter\sfCommonFilter.class.php:30
9	sfFlashFilter->execute()	D:\xampplite\php\pear\symfony\filter\sfFilterChain.class.php:76
10	sfFilterChain->execute()	D:\xampplite\php\pear\symfony\filter\sfFlashFilter.class.php:50
11	sfExecutionFilter->execute()	D:\xampplite\php\pear\symfony\filter\sfFilterChain.class.php:76
12	sfPHPView->render()	D:\xampplite\php\pear\symfony\filter\sfExecutionFilter.class.php:170
13	sfPHPView->renderFile()	D:\xampplite\php\pear\symfony\view\sfPHPView.class.php:222
14	sfPHPView->loadCoreAndStandardHelpers()	D:\xampplite\php\pear\symfony\view\sfPHPView.class.php:83
15	sfLoader::loadHelpers()	D:\xampplite\php\pear\symfony\view\sfPHPView.class.php:73

Change History

09/09/06 12:07:29 changed by pookey

Are you using caching? I'm getting this, but I tihnk it's realted to when you hhave caching on - can you confirm the error goes way when you turn caching off ?

faabian - was going to talk to you about this because I know you've recently done some changes to the cache, so rather then me spending ages trying to figure out what's going on, thought you might know instantly :)

09/09/06 13:26:58 changed by fabien

  • status changed from new to closed.
  • resolution set to invalid.

If you use include_once ('symfony/helper/HelperHelper.php');, you will have problem because later, symfony will try to reload it. So, instead use:

  sfLoader::loadHelpers(array('Text'));

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.