No Exception displayed

Hi,

when I played around with the i18n features (works great!) I tried to set the locale in the configuration (readonly attribute).

The strange thing is that I didn’t get any Exception. I tried to debug (using NB6.5 beta with xdebug) and found that the system assembled the Exception that the locale is readonly but it didn’t manage to display anything. I tried to find out why but at the end of YiiBase::t() the degubber jumps back and the webpage seems to be running again whatever I try ???

Its not a severe bug but perhaps one of you can try it on his system?

D.

I can see the exception using the application created with yiic webapp.

Could you share your app config?

Sure,



<?php





// This is the main Web application configuration. Any writable


// CWebApplication properties can be configured here.


return array(


	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',


	'name'=>'testApplication',


    'language'=>'de',


    'sourceLanguage'=>'en',





	// autoloading model and component classes


	'import'=>array(


		'application.models.*',


		'application.components.*',


	),





	// application components


	'components'=>array(


		'user'=>array(


			// enable cookie-based authentication


			'allowAutoLogin'=>true,


		),


		// uncomment the following to set up database


		/*


		'db'=>array(


			'connectionString'=>'Your DSN',


		),


		*/


	),


);


Not very exciting.

Where did you set locale? I can't find it in your app config.

sorry, this config is running.

exchange language => locale and I get the error.

But it may be that it has to do with my configuration, I will check this.

With my Apache setup I get the same behaviour. I thought it might be a problem with the PHP/Java-Bridge I am using normally.

Perhaps it’s related to the Netbeans 6.5beta I am working with. ???

Which IDE are you using?

I wasn't using any IDE. The exception should appear normally as when you set 'locale' in app config, it will attempt to do $app->locale="something", which should trigger the exception in the __set method of CComponent.

Without debug session and IDE the wrong configuration just leads to an empty window. I tried my normal PHP-Bridge and with the Apache 2.2.6.

I am using PHP 5.2.6.

And you are right, it's no IDE issue and it doesn't depend on the browser either, I tried FF and IE.

Do you think its worth further investigation?

D.

Did you turn on display_errors in php.ini?

What is PHP-Bridge you mentioned?

Could you insert some echo or die statements in CComponent::__set() when setting 'locale' property?

PHP/Java Bridge -> http://php-java-brid…eforge.net/pjb/

Greetings from Hamburg / Germany

  • rojaro -

Hi, I had the display_errors switched Off. Switched it on now but don't get any errors displayed on the screen. I have an uncaught Exception in the php-error.log



[16-Oct-2008 08:33:29] PHP Fatal error:  Uncaught exception 'CException' with message 'Property "CWebApplication.locale" is read only.' in F:workSourcenYiiframeworkcoreCComponent.php:138


Stack trace:


#0 F:workSourcenYiiframeworkcollectionsCConfiguration.php(102): CComponent->__set('locale', 'de')


#1 F:workSourcenYiiframeworkcoreCApplication.php(749): CConfiguration->applyTo(Object(CWebApplication))


#2 F:workSourcenYiiframeworkcoreCApplication.php(107): CApplication->configure('F:worktheMach...')


#3 F:workSourcenYiiframeworkYiiBase.php(74): CApplication->__construct('F:worktheMach...')


#4 F:worktheMachinerywebsitetrunkwebrootindex.php(11): YiiBase::createWebApplication('F:worktheMach...')


#5 {main}


  thrown in F:workSourcenYiiframeworkcoreCComponent.php on line 138


I inserted the follwoing into the CComponent:set() method:

        echo "CComponent:set() $name, $value <br/>"; flush();


which in return printed



CComponent:set() locale, de


CComponent:set() language, en_us


into the windows.

I hope this helps.

D.

So your PHP error log already says about the error. I think you probably need to configure your server in some way in order to display the exception on screen. I'm not sure how to do it in your case though. There's nothing we can do inside the framework.

Normally I rely on display_errors=On and the framework ability to display beautiful error messages :) but this time it didn’t work.

What do you think about



	public function __construct($config=null)


	{


		Yii::setApplication($this);


		$this->registerCoreComponents();


      $this->initSystemHandlers();


		$this->configure($config);


		$this->init();


	}


an taking the initialization of the system_handlers out of the init() method?

D.

Done.

Cool, thank you!  :)