icaza Posted January 22, 2013 Report Share Posted January 22, 2013 Saludosme sale el siguiente error en un componente que estoy creando para joomla "Call to a member function getLista() on a non-object in"tambien sale en que linea el error es tirado .. agrego la funcion en donde se encuentra function display(){global $mainframe; $db =& JFactory::getDBO();$user = & JFactory::getUser();$option = JRequest::getCmd('option'); $context = 'com_aranceles.aranceles.list.';$filtro = new stdClass;$mainframe = JFactory::getApplication();$filtro->order = $mainframe->getUserStateFromRequest( $context.'filter_order', 'filter_order', 'id', 'cmd' );$filtro->order_Dir = $mainframe->getUserStateFromRequest( $context.'filter_order_Dir', 'filter_order_Dir', 'ASC', 'word' );$filtro->palabra = $mainframe->getUserStateFromRequest( $option.'filtro_palabra', 'filtro_palabra', '', 'string' );$filtro->estado = $mainframe->getUserStateFromRequest( $option.'filtro_publicado', 'filtro_publicado', ' ', 'string' ); $filtro->limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' );$filtro->limitstart = $mainframe->getUserStateFromRequest( $context.'limitstart', 'limitstart', 0, 'int' ); $lists = array(); $snh = array();$snh[] = JHTML::_('select.option', ' ' , '- Estado -', 'valor', 'texto' ); $snh[] = JHTML::_('select.option', 'P', 'Publicados', 'valor', 'texto' ); $snh[] = JHTML::_('select.option', 'U', 'Despublicados', 'valor', 'texto' ); $lists['publicado'] = JHTML::_('select.genericlist', $snh, 'filtro_publicado', 'style="width:150px;" onchange="document.adminForm.submit();"' , 'valor', 'texto', $filtro->estado ); $aranceles =& JTable::getInstance('aranceles', 'DO');$rows = $aranceles->getLista( $filtro ); jimport('joomla.html.pagination');$pageNav = new JPagination( $aranceles->getTotal(), $filtro->limitstart, $filtro->limit ); // table ordering$lists['order_Dir'] = $filtro->order_Dir;$lists['order'] = $filtro->order; // search filter$lists['palabra'] = $filtro->palabra; require_once(JPATH_COMPONENT.DS.'views'.DS.'aranceles.php');DoVistaAranceles::display( $rows, $lists, $pageNav );} tube que agregar "$mainframe = JFactory::getApplication();" ya que no me reconocia "$mainframe->getUserStateFromRequest()"aun que no creo que sea el problema no esta demas decirlesbueno por ultimo les agrego los los codigos del GetLista: function getLista( $filtro ){// preparamos el filtro$this->getFiltro( $filtro ); $query = "SELECT COUNT(c.id) AS total". " FROM $this->_tbl AS c"/*. " LEFT JOIN #__users AS uc ON uc.id = l.userid". " LEFT JOIN #__categories AS cc ON cc.id = l.catid". " LEFT JOIN #__users AS um ON um.id = l.modificado_por"*/. $filtro->where//. " GROUP BY c.id". $filtro->orden;$this->_db->setQuery( $query );$filtro->total = $this->_db->loadResult(); $query = "SELECT c.*". " FROM $this->_tbl AS c"/*. " LEFT JOIN #__do_productos AS pp ON pp.catid = c.id". " LEFT JOIN #__users AS uc ON uc.id = l.userid". " LEFT JOIN #__categories AS cc ON cc.id = l.catid". " LEFT JOIN #__users AS um ON um.id = l.modificado_por"*/. $filtro->where. " GROUP BY c.id". $filtro->orden; $this->_db->setQuery( $query, $filtro->limitstart, $filtro->limit );$rows = $this->_db->loadObjectList(); if( count( $rows ) ){foreach( $rows as $i => $row ){//$this->detalles( $rows[$i] );}} return $rows;} Bueno cualquier clase de ayuda es bien recibida... resulta que este componente de joomla no lo cree yo ,pero tube que migrar una web y entre tanto e tenido que trabajar con el codigo... la verdad no estoy al tanto de que significa el error... quiere decir que no estoy dando ninguna clase de variable a la funcion getlista??? cualquier ayudade cualquier tipo es bienvenida ...Gracias por la atencionAttte Ud icaza Link to comment Share on other sites More sharing options...
AshWilliams Posted January 22, 2013 Report Share Posted January 22, 2013 Te funciona con algunos datos....por ejemplo son 64 datos y te muestra 42 y se cae??.....ya me he enfrentado a ese tipo de errores :tonto: PS: La vez que me paso era porque una subconsulta me devolvía más de 1 resultado o al rodenar me repería resultados....en general es un error de consulta sql.....corre la misma consulta en tu gestor de mysql dale los mismos datos como parámetros y ve que resultado te arroja ;) Saludos :krider: Link to comment Share on other sites More sharing options...
icaza Posted January 22, 2013 Author Report Share Posted January 22, 2013 Gracias por la ayuda... pero no era eso xdera la variable $aranceles que estaba llamando una clase que no existia... la escribi mal... de toddas maneras mil gracias... creo que eres el primero que me responde una de mis dudas en foro en muxo tiempo xdSaludos Link to comment Share on other sites More sharing options...
AshWilliams Posted January 22, 2013 Report Share Posted January 22, 2013 De nada cumpa.....hay que confiar en el corazón de las cartas man :tonto: Saludos :krider: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now