I get this error very often in my app error log: 

2010-03-16T08:16:45+01:00 ERR (3): exception 'Zend_View_Exception' with
message 'script 'pretraga/oglasi-broj.phtml' not found in path
(.../application/modules/default/views/scripts/)' in
..../library/Zend/View/Abstract.php:976 
Stack trace: 
#0 .../library/Zend/View/Abstract.php(876):
Zend_View_Abstract->_script('pretraga/oglasi...') 
#1 .../library/Zend/Controller/Action/Helper/ViewRenderer.php(897):
Zend_View_Abstract->render('pretraga/oglasi...') 
#2 .../library/Zend/Controller/Action/Helper/ViewRenderer.php(918):
Zend_Controller_Action_Helper_ViewRenderer->renderScript('pretraga/oglasi...',
NULL) 
#3 .../library/Zend/Controller/Action/Helper/ViewRenderer.php(957):
Zend_Controller_Action_Helper_ViewRenderer->render() 
#4 .../library/Zend/Controller/Action/HelperBroker.php(277):
Zend_Controller_Action_Helper_ViewRenderer->postDispatch() 
#5 .../library/Zend/Controller/Action.php(523):
Zend_Controller_Action_HelperBroker->notifyPostDispatch() 
#6 .../library/Zend/Controller/Dispatcher/Standard.php(289):
Zend_Controller_Action->dispatch('oglasiBrojActio...') 
#7 .../library/Zend/Controller/Front.php(954):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Controller_Response_Http)) 
#8 .../library/Zend/Application/Bootstrap/Bootstrap.php(97):
Zend_Controller_Front->dispatch() 
#9 .../library/Zend/Application.php(366):
Zend_Application_Bootstrap_Bootstrap->run() 
#10 .../public_html/index.php(24): Zend_Application->run() 
#11 {main} 

Problematic controller: 

class PretragaController extends Zend_Controller_Action { 
        public function init() { 
                $this->_helper->ajaxContext 
                        ->setActionContext('oglasi-broj', 'json') 
                        ->initContext(); 
        } 

public function oglasiBrojAction() { 
///... 
} 
} 

Since that is json action, no view script is required. Note that I have used
setActionContext, not addActionContext, since I want this action to exist
only in json context. 

I call this ajax action when any of fields in my search form changes 

searchChange : function() { 
                var form = $('#search_form'); 
                auto.ajaxQueue.push($.ajax({ 
                        url: form.attr('action') + '-broj/format/json', 
                        dataType: 'json', 
                        data: form.serialize(), 
                        beforeSend: function() { 
// 
                        }, 
                        complete: function() { 
// 
                        }, 
                        success: function(response) { 
// 
                        } 
                })); 
        }, 

and on page load 

<script type="text/javascript"> 
//<![CDATA[ 
$(document).ready(function() { 
//... 
    auto.searchChange(); 
//... 
}); 
//]]> 

</script> 

So, this action is never called except from javascript, with jQuery ajax
call. 

Similar happends with some other actions which I added with
setActionContext, but this one is very frequent, maybe because this form is
on many pages. 

Do you have any idea why this can happend? Maybe some browsers send wrong
headers, or something like that?
-- 
View this message in context: 
http://n4.nabble.com/Error-log-spammed-with-Zend-View-Exception-script-not-found-in-path-tp1596271p1596271.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to