1

I've just moved an oldish joomla (2.5.14) site to a newer sever.

My php knowledge is very poor.

The error is as follows.

Warning: Creating default object from empty value in /components/com_portfolio/models/portfolio.php on line 46

Line 46 is $this->_params->cat1 = $params->get( 'category1' );

See below

function getParamsFD(){
    $db =& JFactory::getDBO();
    // Get the parameters of the active menu item
    if(FD_JVERSION == '16') {
        $app = JFactory::getApplication();
        $params = $app->getParams();
        $this->_params->cat1 = $params->get( 'category1' );
        $this->_params->cat2 = $params->get( 'category2' );
        $this->_params->cat3 = $params->get( 'category3' );
        $this->_params->cat4 = $params->get( 'category4' );
        $this->_params->height = $params->get( 'theight' );
        $this->_params->width = $params->get( 'twidth' );
        $this->_params->columns = $params->get( 'columns' );
        $this->_params->rows = $params->get( 'rows' );
        $this->_params->piwidth = $params->get( 'piwidth' );
        $this->_params->powidth = $params->get( 'powidth' );
        $this->_params->dheight = $params->get( 'dheight' );
        $this->_params->shadow = $params->get( 'shadow' );
        $this->_params->gmode1 = $params->get( 'gmode1' );
        $this->_params->gmode2 = $params->get( 'gmode2' );
        $this->_params->gmode3 = $params->get( 'gmode3' );
        $this->_params->gmode4 = $params->get( 'gmode4' );
        $this->_params->tdmode1 = $params->get( 'tdmode1' );
        $this->_params->tdmode2 = $params->get( 'tdmode2' );
        $this->_params->tdmode3 = $params->get( 'tdmode3' );
        $this->_params->tdmode4 = $params->get( 'tdmode4' );
        $this->_params->thmode1 = $params->get( 'thmode1' );
        $this->_params->thmode2 = $params->get( 'thmode2' );
        $this->_params->thmode3 = $params->get( 'thmode3' );
        $this->_params->thmode4 = $params->get( 'thmode4' );
    } else {

Any help will be gratefully appreciated.

migrated from stackoverflow.com Oct 21 '14 at 10:11

This question came from our site for professional and enthusiast programmers.

  • If a 3rd party extension is throwing error messages, then please contact the developer. This is something they should be notified about so they can fix it and release an update – Lodder Oct 20 '14 at 19:22
  • It is but unfortunately they are no longer available. I'd be quite happy if I could just suppress the message as it appears not to affect the workings in any way. – Legin76 Oct 21 '14 at 9:56
2

It would seem that your new server has a higher PHP version which is why it's throwing this error.

If you have access to your php.ini file, then try changing:

error_reporting = E_ALL

to:

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

If you do not have access to this file, then you could do it by adding some PHP code, however this means editing a core file which I would not recommend. Instead, try adding default values to these parameters. The second argument gets used if no value has been specified:

$this->_params->cat1 = $params->get( 'category1', 'default' );

Do this for all the parameters.

I would also recommend you upgrade to Joomla 2.5.27 as you are 13 versions behind

  • Thanks Lodder.. I do have access to the php.ini but it's a shared server. I'm afraid that the php above made no difference. I managed to suppress the error though by using error_reporting(0); in the file. I've also updated Joomla as recommended. – Legin76 Oct 21 '14 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.