Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

compatibility with php5.5 03 Apr 2015 14:58 #12905

  • LJ01
  • LJ01's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 78
  • Thank you received: 2
Hi
i update my website with php5.5, but my component have a problem

Fatal error: Call-time pass-by-reference has been removed in /home/batenerg/www/components/com_batenergie/controllers/statbat.php on line 102
function save()
    {        // Check for request forgeries
        JRequest::checkToken() or jexit( 'Invalid Token' );

        $model = $this->getModel('batenergiepartitem');
        $item = $model->getItem();

        if ($model->getId() == 0)
        {    //New item

            if (!$this->can('core.create', JText::_("BATENERGIE_JTOOLBAR_SAVE")))
                return;
        }
        else
        {    //Existing item
            if (!$this->can(array('core.edit', 'core.edit.own'), JText::_("BATENERGIE_JTOOLBAR_SAVE")))
                return;

            //Check Item ACL
            if (!$this->can('access-edit', JText::_("BATENERGIE_JTOOLBAR_SAVE"), $item->params))
                return;
        }
        $post    = JRequest::get('post');
        $post['id'] = $model->getId();

        //UPLOAD FILE : Image
[color=#ff0000][b]102[/b][/color]
if (!$this->_upload('image', &$post, array(
            'image/bmp' => 'bmp',
            'image/gif' => 'gif',
            'image/jpeg' => 'jpg,jpeg',
            'image/png' => 'png'), 
            array('maxSize' => 512000,
            )))
        return;    

        $post['description'] = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWRAW);
        $post['travaux'] = JRequest::getVar('travaux', '', 'post', 'string', JREQUEST_ALLOWRAW);

        if ($cid = parent::_save($post))
        {
            $vars = array();
            $layout = JRequest::getVar( 'layout');
            switch($layout)
            {
                case 'batenergiepartitem':
                    JRequest::setVar( 'view'  , 'batenergiepart');
                    JRequest::setVar( 'layout', 'default' );
                    JRequest::setVar( 'cid', null );
                    break;


                default:
                    JRequest::setVar( 'view'  , 'batenergiepart');
                    JRequest::setVar( 'layout', 'default' );
                    JRequest::setVar( 'cid', null );
                    break;
            }

            $this->setRedirect(BatenergieHelper::urlRequest($vars));
        }
        else
            //Keep the post and stay on page
            parent::display();

    }
an idea please LJ
Ce sont les fils qui font les cordes
ingall-niger.org

Please Log in or Create an account to join the conversation.

Last edit: by LJ01.
  • Page:
  • 1
Time to create page: 0.107 seconds

This is what you call a component builder. I was able to master using this in a very short time and the resulting component works like a charm. Not just a basic component builder but a fully working component builder with forms fields tables all ready to go. You can make the list and item views to display in the front and back end. Also there is a great forum just starting to evolve and I'm sure this will grow very rapidly when you all realise how good this tool is.
Kevin (JED)

         

Get Started