Problem with the contact component.

Discussion regarding Joomla! 2.5 Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
cherylmcr41
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue May 31, 2011 8:14 pm

Problem with the contact component.

Post by cherylmcr41 » Tue May 31, 2011 9:14 pm

I am currently building a site using a 1.6 template that was created 05/12/2011 on joomla 1.63 stable.
Currently I have set up a contact us link to one contact and below is the result that I get.

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\environcc\components\com_contact\models\category.php on line 84

and this is followed by the contact information.
I am currently using xammp to work on the site. It is not yet live.


Below is the code from the link quoted up to line 121. Any help will be appreciated

<?php
/**
* @version $Id: category.php 21097 2011-04-07 15:38:03Z dextercowley $
* @package Joomla.Site
* @subpackage com_contact
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

// No direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.modellist');

/**
* @package Joomla.Site
* @subpackage com_contact
*/
class ContactModelCategory extends JModelList
{
/**
* Category items data
*
* @var array
*/
protected $_item = null;

protected $_articles = null;

protected $_siblings = null;

protected $_children = null;

protected $_parent = null;

/**
* The category that applies.
*
* @access protected
* @var object
*/
protected $_category = null;

/**
* The list of other newfeed categories.
*
* @access protected
* @var array
*/
protected $_categories = null;

/**
* Constructor.
*
* @param array An optional associative array of configuration settings.
* @see JController
* @since 1.6
*/
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'name', 'a.name',
'con_position', 'a.con_position',
'suburb', 'a.suburb',
'state', 'a.state',
'country', 'a.country',
'ordering', 'a.ordering',
);
}

parent::__construct($config);
}

/**
* Method to get a list of items.
*
* @return mixed An array of objects on success, false on failure.
*/
public function &getItems()
{
// Invoke the parent getItems method to get the main list
$items = &parent::getItems(); /** this is line 84*/

// Convert the params field into an object, saving original in _params
for ($i = 0, $n = count($items); $i < $n; $i++) {
$item = &$items[$i];
if (!isset($this->_params)) {
$params = new JRegistry();
$params->loadJSON($item->params);
$item->params = $params;
}
}

return $items;
}

/**
* Method to build an SQL query to load the list data.
*
* @return string An SQL query
* @since 1.6
*/
protected function getListQuery()
{
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());

// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);

// Select required fields from the categories.
$query->select($this->getState('list.select', 'a.*') . ','
. ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug, '
. ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END AS catslug ');
$query->from('`#__contact_details` AS a');
$query->join('LEFT', '#__categories AS c ON c.id = a.catid');
$query->where('a.access IN ('.$groups.')');

Thank you for the help

 
 
Locked

Return to “Performance - Joomla! 2.5”