Zend - Fatal error: Uncaught Zend_View_Exception: script '/.phtml' - zend-framework

Get the following error message on my app. The app is written with the Zend framework, but not by myself. Can anyone tell me what the error message says.
It is about an extra module after all and a template file is missing. Is that correct so far? Can I just copy it in there myself?
Fatal error: Uncaught Zend_View_Exception: script '/.phtml' not found in path
(/application/modules/default/views/scripts/) in
/library/Zend/View/Abstract.php:987 Stack trace: #0
/library/Zend/View/Abstract.php(883): Zend_View_Abstract->_script('/.phtml')
#1 /library/Zend/Controller/Action/Helper/ViewRenderer.php(910):
Zend_View_Abstract->render('/.phtml') #2
library/Zend/Controller/Action/Helper/ViewRenderer.php(931):
Zend_Controller_Action_Helper_ViewRenderer->renderScript('/.phtml', NULL) #3
library/Zend/Controller/Action/Helper/ViewRenderer.php(970):
Zend_Controller_Action_Helper_ViewRenderer->render() #4
/libr in
library/Zend/Controller/Plugin/Broker.php on line 335
Would be very grateful for any tip.
Greetz Bavra

Related

Flutter - Async file reading exception handling

I am new to dart/flutter and a litte confused by the async-await flutter exception handling in this case.
So basically i have this function that loads a .json settings file from the flutter data folder.
Its supposed to load the settings and throw a SettingsLoadingException in the case it's unable to find the file, so the calling function knows when to create a new one.
This mechanism works, but two things are confusing me in this case. First of all it's still printing an uncaught FileSystemException to the console even though the print "No settings file!" shows it got caught. Secondly "No settings file" and the error are printed twice - so is it catching two errors?
Future<Settings> loadSettings() async {
try {
String fileName = SettingsService.settingsFileName;
File file = File("${await _localPath}/${dbFolderName}/${fileName}");
String fileContent = await file.readAsString();
Map<String, dynamic> settingJsonMap = jsonDecode(fileContent);
Settings settings = Settings.fromJson(settingJsonMap);
return settings;
} catch (e) {
print("No settings file!");
throw SettingsLoadingException("Unable to load settings");
}
}
I/flutter (10533): No settings file!
I/flutter (10533): No settings file!
E/flutter (10533): \[ERROR:flutter/runtime/dart_vm_initializer.cc(41)\] Unhandled Exception: FileSystemException: Cannot open file, path = '/data/user/0/com.yapps.smartdart/app_flutter/db/settings.json' (OS Error: No such file or directory, errno = 2)
E/flutter (10533): #0 \_File.open.\<anonymous closure\> (dart:io/file_impl.dart:356:9)
E/flutter (10533): \<asynchronous suspension\>
E/flutter (10533):
E/flutter (10533): \[ERROR:flutter/runtime/dart_vm_initializer.cc(41)\] Unhandled Exception: FileSystemException: Cannot open file, path = '/data/user/0/com.yapps.smartdart/app_flutter/db/settings.json' (OS Error: No such file or directory, errno = 2)
E/flutter (10533): #0 \_File.open.\<anonymous closure\> (dart:io/file_impl.dart:356:9)
E/flutter (10533): \<asynchronous suspension\>
E/flutter (10533):
E/SurfaceSyncer(10533): Failed to find sync for id=0
W/Parcel (10533): Expecting binder but got null!
I already tried using the .then and .catchError API which didn't work and led me to a totally different error.
The first thing you're confused about, FileSystemException is an error on the native side of the plugin you're using. So don't worry about that. the error is just getting caught on the plugin side and so does the error message that is being printed.
And The second thing which is messages getting printed twice should not have anything to do with the FileSystemException. My guess is you're calling the method twice. If so, you can confirm this by running this code in debug mode and using break points

FPDF works locally but not online

I have a FPDF output which works perfectly locally but there is problem online.
The error is:
Fatal error: Uncaught exception 'Exception' with message 'FPDF error: Some data has already been output, can't send PDF file (output started at /home/wa/public_html/razpis/baza.inc.php:1)' in /home/wa/public_html/razpis/fpdf.php:271
Stack trace:
#0 /home/wa/public_html/razpis/fpdf.php(1052): FPDF->Error('Some data has a...')
#1 /home/wa/public_html/razpis/fpdf.php(1012): FPDF->_checkoutput()
#2 /home/wa/public_html/razpis/naredipdf.php(169): FPDF->Output('razpis.pdf', 'D')
#3 /home/wa/public_html/razpis/razpis5.php(136): require('/home/wa...')
#4 /home/wa/public_html/razpis/index.php(165): include_once('/home/wa...')
#5 {main} thrown in /home/wa/public_html/razpis/fpdf.php on line 271

Cant use $this->_forward() on zend

i am trying to use $this->_forward($action,$controller); at my view, but i am getting this error:
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name '_forward' was not found in the registry; used paths: Zend_View_Helper_: Zend/View/Helper/;C:/Program Files (x86)/Zend/Apache2/htdocs/dentallab/application/modules/default/views\helpers/' in C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\Loader\PluginLoader.php:412
Stack trace:
#0 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(1182): Zend_Loader_PluginLoader->load('_forward')
#1 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(618): Zend_View_Abstract->_getPlugin('helper', '_forward')
#2 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(344): Zend_View_Abstract->getHelper('_forward')
#3 C:\Program Files (x86)\Zend\Apache2\htdocs\dentallab\application\modules\default\views\scripts\institucional\index.phtml in C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\Controller\Plugin\Broker.php on line 336
if anyone can help me, i appreciate!
You can use Action View Helper for this situation
in the view,
<?php echo $this->action('action',
'controller',
'module',
array('param' => 10)); ?>
Here is the link to the ZF manual Action View Helper

ZF - How to render a view with its controller?

I want to call another view from my view, but I need this new one to be processed with its controller, so I can have my SQL queries.
I am using $this->render('new-view.phtml') but this does not process the controller together, it returns only the view.
Anybody know how to do it? Thanks!
EDITED
Using $this->_forward(); i got this error:
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'RenderScript' was not found in the registry; used paths: Zend_View_Helper_: Zend/View/Helper/;C:/Program Files (x86)/Zend/Apache2/htdocs/dentallab/application/modules/default/views\helpers/' in C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\Loader\PluginLoader.php:412 Stack trace: #0 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(1182): Zend_Loader_PluginLoader->load('RenderScript') #1 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(618): Zend_View_Abstract->_getPlugin('helper', 'renderScript') #2 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(344): Zend_View_Abstract->getHelper('renderScript') #3 C:\Program Files (x86)\Zend\Apache2\htdocs\dentallab\application\modules\default\views\scripts\instituci in C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\Controller\Plugin\Broker.php on line 336
You can use
$this->_forward($action, $controller);
as thom suggested if you want to use you controller and view script from another view script .

Zend Framework Disapatcher error so suddnly

is about a week I work for an application and now, yesterday i receive this error and than so suddnly has disappeared and I continued to work! now i receive again this error but without any change!
how can i solve it?
thanks
Warning: include_once(/www/zendsvr/htdocs/TassiWeb/application/controllers/LoginController.php) [function.include-once]: failed to open stream: Too many open files in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php on line 344
Warning: include_once() [function.include]: Failed opening '/www/zendsvr/htdocs/TassiWeb/application/controllers/LoginController.php' for inclusion (include_path='/www/zendsvr/htdocs/TassiWeb/application/../library:/www/zendsvr/htdocs/TassiWeb/library:.:/usr/local/zendsvr/share/ZendFramework/library:/usr/local/zendsvr/share/pear') in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php on line 344
Warning: include_once(/www/zendsvr/htdocs/TassiWeb/application/controllers/ErrorController.php) [function.include-once]: failed to open stream: Too many open files in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php on line 344
Warning: include_once() [function.include]: Failed opening '/www/zendsvr/htdocs/TassiWeb/application/controllers/ErrorController.php' for inclusion (include_path='/www/zendsvr/htdocs/TassiWeb/application/../library:/www/zendsvr/htdocs/TassiWeb/library:.:/usr/local/zendsvr/share/ZendFramework/library:/usr/local/zendsvr/share/pear') in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php on line 344
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller class ("ErrorController")' in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php:352
Stack trace:
/usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php(262): Zend_Controller_Dispatcher_Standard->loadClass('ErrorController')
/usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
/usr/local/zendsvr/share/ZendFramework/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
/usr/local/zendsvr/share/ZendFramework/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
/www/zendsvr/htdocs/TassiWeb/public/index.php(26): Zend_Application->run()
{main}
thrown in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php on line 352
Zend needs a lot of files open. But the 'too many open files' issue is connected with recursion; particularly a loop of files where A includes B includes C includes A (for instance.)
With Zend you shouldn't need to manually include files for the most part, since it uses auto-loading. In that week's time I'm thinking you may have introduced an accidental recursion.
Remove that recursion (or make sure the includes are include_once/require_once) and you will address the issue.
I had a similar 'too many files' open error and it ended up being that I was extending the wrong Bootstrap class in my module. I was using Zend_Application_Bootstrap_Bootstrap instead of Zend_Application_Module_Bootstrap. So check if you have more than one implementation of Zend_Application_Bootstrap_Bootstrap. Hope that applies to your situation.