I am updating Joomla component to Joomla 3x but getting error on code.
Code Line:
$postData = $this->dr_parameters->app->session->get('errorPostData', array() );
Error:
0 Call to a member function get() on null
and
I replaced the
previous code:
JRequest::get('post');
with
This code:
JFactory::getApplication()->input->get('post');
is this correct?
$this->dr_parameters->app->session
is. If$this->dr_parameters->app->session
is returning a JRequest object then you need to get whatever populates$this->dr_parameters->app->session
to populate it with the new object fromJFactory::getApplication()->input
. Or just change that line to$postData = JFactory::getApplication()->input->get('errorPostData', array());
. Did that not work? – Drew G Sep 8 '17 at 19:20