Yii Framework Forum: No Exception displayed - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

No Exception displayed Rate Topic: -----

#1 User is offline   dyrathror 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-October 08

Posted 15 October 2008 - 08:10 AM

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.

0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 15 October 2008 - 08:23 AM

I can see the exception using the application created with yiic webapp.
Could you share your app config?
0

#3 User is offline   dyrathror 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-October 08

Posted 15 October 2008 - 08:27 AM

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.

0

#4 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 15 October 2008 - 08:29 AM

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

#5 User is offline   dyrathror 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-October 08

Posted 15 October 2008 - 08:32 AM

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.


0

#6 User is offline   dyrathror 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-October 08

Posted 15 October 2008 - 10:23 AM

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?


0

#7 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 15 October 2008 - 10:31 AM

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.
0

#8 User is offline   dyrathror 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-October 08

Posted 15 October 2008 - 12:37 PM

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.



0

#9 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 15 October 2008 - 12:41 PM

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?
0

#10 User is offline   rojaro 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 06-October 08
  • Location:hamburg.de

Posted 15 October 2008 - 05:57 PM

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

Greetings from Hamburg / Germany
- rojaro -
0

#11 User is offline   dyrathror 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-October 08

Posted 15 October 2008 - 07:42 PM

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.

0

#12 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 15 October 2008 - 08:11 PM

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.
0

#13 User is offline   dyrathror 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-October 08

Posted 15 October 2008 - 08:57 PM

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.


0

#14 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 15 October 2008 - 09:30 PM

Done.
0

#15 User is offline   dyrathror 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-October 08

Posted 15 October 2008 - 10:23 PM

Cool, thank you!  :)


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users