Fatal error: Cannot redeclare class JInput in JOOMLA - joomla

Today i just started my first joomla extension. I am using lendr sample joomla3.1 extnsion as a reference
$app = JFactory::getApplication()->input;
$controller = $app->input->get('controller','default');
i got following error on line execution of 2
Fatal error: Cannot redeclare class JInput in C:\Users\arslan\Desktop\xampp-win32-1.8.1-VC9\xampp\htdocs\COM\libraries\joomla\input\input.php on line 34
and line 34 of input.php is just implementation of interface
*/
class JInput implements Serializable, Countable
{
any idea about this error.

Related

Magento - Fatal error(s) after installing module

Just installed Product Accessories on Magento ver. 1.8.0.0
And my whole website went on fatal errors.
Fatal error: Call to a member function getCollection() on a non-object
Fatal error: Call to a member function setStoreId() on a non-object
Fatal error: Class 'Anais_Accessories_Model_Product'
What do I need to do to get the module running smooth? I can't find an other module that does the same like this one.
Your Model file name should be like this-->> AnaisAccessories.php. Rename all the classes in the Model folder start with the Uppercase and rest should be lowercase as AnaisAccessories. As you can see you've error in class 'Anais_Accessories_Model_Product'.
Make sure file ../Model/AnaisAccessories.php should contain below code. Make appropriate change according to your Module.
class Anais_Accessories_Model_Accessories extends Mage_Core_Model_Abstract
{
public function _construct()
{
parent::_construct();
$this->_init('accessories/accessories');
}
}

configure flexigrid helper, and customize variable $colModel

I try to start Flexigrid into Codeigniter.
I download demo files from here http://gembelzillonmendonk.wordpress.com/2010/06/28/flexigrid-and-codeigniter-with-advanced-searching-with-example/
but i wrong to set up something:
Instruction from site:
extract .rar to CI folder**
open your controller (ie: CI_Folder\system\application\controllers\flexigrid.php)**
configure flexigrid helper, and customize variable $colModel, example:**
code example
What I did:
I installed correctly CodeIgniter (copy and paste inside htdocs - xampp)
I created a database called 'country' and import sql file inside demo.
I copied correctly files an folders from demo files to my CI folder (called grocery-crud-demo).
But when I type on firefox http://localhost/grocery-crud-demo/index.php/flexigrid/index I have this error
Fatal error: Class 'Controller' not found in C:\xampp\htdocs\grocery-crud-demo\application\controllers\flexigrid.php on line 2
A PHP Error was encountered
Severity: Error
Message: Class 'Controller' not found
Filename: controllers/flexigrid.php
Line Number: 2
Backtrace:
I read instruction also from here: http://roadmyapps.toile-libre.org/index.php/flexigrid/examplebut I don't understand which code exactly I must have into flexigrid.php
I don't understand how configure flexigrid helper, and customize variable $colModel.
I need exact code into files. Have you idea?
I find CodeIgniter 1.7.3 -- I repeat steps -- new error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Ajax_model::$db
Filename: models/ajax_model.php
Line Number: 34
Fatal error: Call to a member function query() on a non-object in C:\xampp\htdocs\grocery-crud-demo\system\application\models\ajax_model.php on line 34
Code of ajax_model.php is this: http://pastebin.com/P3KawC7S
Probably you are using newer version of CI than one on tutorial.
As I can see tutorial is written for 1.7.2 version.
Try to change
class Someclass extends Controller
{
public function someclass()
{
}
public function index()
{
//etc, etc
}
}
with
class Someclass extends Controller
{
public function __construct()
{
parent::__construct()
{
}
}
public function index()
{
//etc, etc
}
}
Also, for models too. Like
public function Ajax_model()
{
parent::Model();
$this->CI =& get_instance();
}
should be
public function __construct()
{
parent::__construct();
$this->CI =& get_instance();
}
Try that way.
Spot those differences. Those should change in every controller and model respectivelly. Follow this link for upgrading your app.
If fail again, see the CodeIgniter documentation about upgrading versions.

CodeIgniter class loading is not working

I have a class in application/library folder - filename = person_struc.php and the code is following..
class Person_struc {
var $person_id;
var $person_name;
public function set_info($person_id, $person_name) {
$this->person_id = $person_id;
$this->person_first_name = $person_name;
}
}
I have a view (person_list.php) and want to load the class by as follows -
$this->load->library('person_struc');
$this->person_struc->set_info(1,"xxx");
I have controller (person) and model (person_model). But it is generating error..
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$person_struc
Filename: person/person_list.php
Fatal error: Call to a member function set_info() on a non-object in
I tried to solve the problem but failed. Do you have any solution please...
Initial letter of your file name must be capital. In your case it would be filename = Person_struc.php instead of filename = person_struc.php
Try like
class Person_struc extends CI_Controller
your class must be locate in library.
your class name and file name are same.
and your person_list controller must be extends CI_CONTROLLER

Extending CI_Controller / Indirect modification of overloaded property [duplicate]

This question already has answers here:
Call to a member function on a non-object [duplicate]
(8 answers)
Closed 10 years ago.
the CI community seems to have no answer to this (or maybe it is so obvious, that it looks like a noob question?), so I ask here.
I've been seeing this kind of error for a long time now (error messages follow), however I have always used this "dirty" workaround. Now I do not want to edit the core CI code anymore, and I know there must be a graceful solution to this.
Here is the setup.
In my application/config/routes I have this
$route['default_controller'] = "dispatcher";
The Dispatcher class in application/controllers/ is defined as this:
class Dispatcher extends MY_Controller {
function __construct() {
parent::__construct();
$this->load->helper(array('form','https'));
}
function index() {
# load models
$this->load->model('site/map');
$this->load->model('site/langs');
$this->load->model('site/pages');
if ( $mapped = $this->map->get_map() ){ // this is the line 21
$this->langs->set_user_lang( $this->GLO['show_lang_in_url'], $this->GLO['show_lang_at_home'] );
$red = base_url().$this->GLO['user_lang_label']."/".$mapped;
redirect($red, "refresh");
}
...
now MY_Controller resides in application/core and is defined as follows:
class MY_Controller extends CI_Controller {
public function __construct() {
parent::__construct();
$this->GLO = array();
#
# set defaults:
#
$this->GLO['deb'] = '';
$this->GLO['baseurl'] = base_url();
... (more GLO[key] = value )
}
public function __set ($key, $value ) {
$this->GLO[$key] = $value;
}
Every model I use starts like this (named accordingly):
class Map extends CI_Model {
function __construct(){
parent::__construct();
}
function get_map(){
.....
return true;
}
Now with CI 2.1.2, PHP 5.3.3, Apache 2 on Debian when trying to load a page, I am getting this error:
A PHP Error was encountered Severity: Notice Message: Indirect
modification of overloaded property Langs::$GLO has no effect
Filename: site/langs.php Line Number: 82
A PHP Error was encountered Severity: Notice Message: Undefined
property: Dispatcher::$map Filename: controllers/dispatcher.php Line
Number: 21
Fatal error: Call to a member function get_map() on a non-object in
/home/webdev/MC/_WWW/application/controllers/dispatcher.php on line 21
The line 21 is the one marked above in the Map model
if ( $mapped = $this->map->get_map() ){
the line 82 in the other model looks like this:
$this->GLO['langs'][] = $temp;
Throughout the code, this GLO array is referenced as $this-GLO[key]. It must be read and written from time to time. If I delete the __set function in MY_Controller, I get more of those warnings.
Where is the problem?
Thanks a lot in advance!
I'm not sure about the first error - but these two:
A PHP Error was encountered Severity: Notice Message: Undefined
property: Dispatcher::$map Filename: controllers/dispatcher.php Line
Number: 21
Fatal error: Call to a member function get_map() on a non-object in
/home/webdev/MC/_WWW/application/controllers/dispatcher.php on line 21
...look like you havent loaded your model correctly?
change
if ( $mapped = $this->map->get_map() ){
to
$this->load->model('map');
if ( $mapped = $this->map->get_map() ){

Joomla and DOMPDF integration errors

I'm trying to integrate DOMPDF to our Joomla (Version 1.5.24) project and I keep getting these errors:
Strict standards: Non-static method JLoader::load() should not be called statically in C:\xampp\htdocs\proj\libraries\loader.php on line 162
Strict standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\proj\libraries\loader.php on line 139
Fatal error: Class 'DOMPDF' not found in C:\xampp\htdocs\proj\components\com_reports\views\details\view.pdf.php on line 23
Strict standards: Non-static method JFactory::getDBO() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\oasis\libraries\joomla\session\storage\database.php on line 84
Strict standards: Non-static method JTable::getInstance() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\oasis\libraries\joomla\session\storage\database.php on line 89
Strict standards: Non-static method JFactory::getDBO() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\oasis\libraries\joomla\database\table.php on line 112
The function that instantiates the DOMPDF object is located in one of the views of the component:
class ReportsViewDetails extends JView{
function display($tpl = null){
global $mainframe;
//echo "hello";
$this->generatePDF();
}
function generatePDF(){
require_once("./components/com_reports/helper/dompdf/dompdf_config.inc.php");
$html =
'<html><body>'.
'<p>Put your html here, or generate it with your favourite '.
'templating system.</p>'.
'</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
}
}
It sees the file that is required but dompdf_config.inc.php outputs errors described above. I'm not sure what is causing this since the file only contains define lines and an autoload function. The content of the file can be seen here: http://code.google.com/p/dompdf/source/browse/trunk/dompdf/dompdf_config.inc.php.
Please help! Thanks!
all those strict standard warnings you are getting is becuase of this line
error_reporting(E_STRICT | E_ALL);
in dompdf_config.inc.php
and you should include dompdf/include/dompdf.cls.php

Resources