Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Member function process() on null #418

Open
tomasr1981 opened this issue May 2, 2024 · 3 comments
Open

Member function process() on null #418

tomasr1981 opened this issue May 2, 2024 · 3 comments

Comments

@tomasr1981
Copy link

Hi, I found an error that I can't locate, or rather I don't know what caused it. The truth is that I'm using PHP 8.2, but I'm not sure if that makes a difference.

I am using the following code in simple-template.tpl.php, yet the error says that there is an error on line 246.


<?php if (!is_null($this->actionScript)) : ?>
    <?php echo $this->render($this->actionScript); ?>
<?php endif; ?>
Call to a member function process() on null
#0 /www/doc/www.bryle-domu.cz/www/library/Zend/View.php(157): include()
#1 /www/doc/www.bryle-domu.cz/www/library/Zend/View/Abstract.php(886): Zend_View->_run('application/vie...')
#2 /www/doc/www.bryle-domu.cz/www/application/views/scripts/cs/_common/simple-template.tpl.php(246): Zend_View_Abstract->render(NULL)
#3 /www/doc/www.bryle-domu.cz/www/library/Zend/View.php(157): include('/www/doc/www.br...')
#4 /www/doc/www.bryle-domu.cz/www/library/Zend/View/Abstract.php(886): Zend_View->_run('application/vie...')
#5 /www/doc/www.bryle-domu.cz/www/library/Venturia/Controller/Action/Helper/SimpleTemplateViewRenderer.php(81): Zend_View_Abstract->render(NULL)
#6 /www/doc/www.bryle-domu.cz/www/library/Zend/Controller/Action/Helper/ViewRenderer.php(931): Venturia_Controller_Action_Helper_SimpleTemplateViewRenderer->renderScript('index/simple-pa...', NULL)
#7 /www/doc/www.bryle-domu.cz/www/library/Zend/Controller/Action/Helper/ViewRenderer.php(970): Zend_Controller_Action_Helper_ViewRenderer->render()
#8 /www/doc/www.bryle-domu.cz/www/library/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#9 /www/doc/www.bryle-domu.cz/www/library/Zend/Controller/Action.php(533): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#10 /www/doc/www.bryle-domu.cz/www/library/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('simplePageActio...')
#11 /www/doc/www.bryle-domu.cz/www/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#12 /www/doc/www.bryle-domu.cz/www/index.php(157): Zend_Controller_Front->dispatch()

What exactly causes the framework error and how can it be fixed?

@rruchte
Copy link

rruchte commented May 2, 2024

Venturia/Controller/Action/Helper/SimpleTemplateViewRenderer.php is not a Zend Framework class, but it looks like that's where the bug is. It is calling Zend_View_Abstract->render with a null argument, but the argument should be the name of a template file. ZF should probably throw an error in this case, but it does not, so you deal with the natural consequences of trying to render with a null template file name.

@tomasr1981
Copy link
Author

You're right, I forgot to mention that. However, this line is treated and the mentioned function should not be called with a null template.

80    if (!is_null($layoutScript)) {
81        $layoutContent = $this->view->render($layoutScript);
82        $this->getResponse()->appendBody($layoutContent, $name);
84    }

So listing the error doesn't make much sense. Do you have any idea?

@rruchte
Copy link

rruchte commented May 3, 2024

I would run that in a debugger and see what is actually happening, there is no way to tell from this, other than it's something unexpected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants