[Solved] CClientScript does not render script files

I already posted this in the german sub-forum a week ago but until now there is no answer. I will try to translate my original post as good as possible;)



[font="arial, verdana, tahoma, sans-serif"][size="2"]I found out that for special logged in users registerCoreScript/registerClientScript does not work. When the user is logged out, everything works fine, also for the majority of the users logged in (Until know this is only a dev-project with 10 "self-made" users). But when I login as a special user (i will call him "A") it does not work. [/size][/font][font="arial, verdana, tahoma, sans-serif"][size="2"]layout/main.php

<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>


<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl.'/js/main.js'); ?>

So i deleted A in the DB, but then the problem appears with user B logged in. Before I deleted A, everything was fine with B…[/size][/font][font="arial, verdana, tahoma, sans-serif"][size="2"]When i dump Yii::app()->clientScript after the registration of the coreScript, the variables show me that it was registered successfully, but it does not appear in the HTML code.[/size][/font]

[size="2"]Can someone explain me this behavior?[/size]

Looks like application specific bug to me.

I think you are right…but what can prevent clientScript to render?

Hmm… can be renderPartial instead of render. Can be premature script end using die or exit.

So obvious…

I was firmly convinced that i proved that there were no errors in the application.log. And i still believe there were no:D. But i looked into the HTML code and at the end there was 1 PHP notice. That was the reason the script stopped. Thank you. Don’t know why i didn’t noticed it before…In german there is a phrase “I do not see the trees in the forest” and in this context it fits pretty well;)