Issue upgrading Joomla 1.5 to Joomla 2.5 - php

I'm having many issues upgrading a custom Joomla site from Joomla 1.5 to 2.5. I have the template installed on the back end, but the front end keeps displaying error messages. I don't really know too much PHP, so I'm having a hard time trying to figure out what is all going on.
First, I use jupgrade to upgrade the core of the site.
Then I followed this video to make the custom site template ready for Joomla 2.5:
http://www.youtube.com/watch?v=xqnm1DJn3jE
In my "/jupgrade/templates/my-template/menus/ folder there is a file called Base.class.php.
When I try to go the new home page of my site, in the /jupgrade/ folder, I get the following error:
Fatal error: Class 'JParameter' not found in ../public_html/jupgrade/templates/my-template/menus/Base.class.php on line 46
Line 46 reads:
function createParameterObject($param, $path='', $type='menu') {
return new JParameter($param, $path); }
According to this website (http://docs.joomla.org/Upgrading_a_Joomla_1.5_extension_to_Joomla_1.6#Converting_Your_JParameters_to_JForms) I need to change "JParameters" to "JForm".
When I change it, I now am getting the following error when going to the home page:
Catchable fatal error: Argument 2 passed to JForm::__construct() must be an array, string given, called in ../public_html/jupgrade/templates/my-template/menus/Base.class.php on line 46 and defined in ../public_html/jupgrade/libraries/joomla/form/form.php on line 80
Line 80 of the form.php file is:
public function __construct($name, array $options = array())
{
// Set the name for the form.
$this->name = $name;
// Initialise the JRegistry data.
$this->data = new JRegistry;
// Set the options if specified.
$this->options['control'] = isset($options['control']) ? $options['control'] : false;
}
Does anyone have any advice on how to solve this issue?

Actually you don't need to change JParameter to JForm. We had the exact issues before and we have explained them here.
JParameter is no longer included by default in Joomla 2.5. In short, you will need to include using the jinclude directive. That's actually the fastest way to solve your problem.
Revert back your changes and just include the JParameter class.

Related

Can't load main website or the Magento /admin page. Just loads as a blank page! Error log provided

Our site has been down since I tried doing a backup of our Magento site. This was the last thing I did that could have triggered something. I had made other changes throughout the day, but only playing with some extensions, and this was a couple hours prior to the error. Below is the last entry to the error log:
[16-Jun-2015 18:42:56 UTC] PHP Fatal error: Call to a member function
setLayer() on a non-object in
**public_html/app/code/core/Mage/Catalog/Block/Layer/View.php on line 134
Got into the line its calling to but have no idea what to do with it! Not even sure if this is the direct cause of this issue. I feel something should still load.
Could it be something simple I'm missing like a Maintenance flag?
Any other reasons why the site could be behaving like this? Quite frustrating that I cant even reach the admin page. All our other subdomain site work too.
It would appear to me that somewhere in your coding of some extensions you broke something. This error happens when you have what you think is an object but is actually not and you call a method on it.
for instance if you have something like the following
<?php
$obj = function_to_get_object('name');
$obj->getName();
if the function_to_get_object does not return an object but rather returns NULL or false then calling the method getName will fail because the variable is not an object rather NULL or FALSE.
I could not see this happening with a Magento install (without custom code) unless maybe you deleted a file or something and the base install cannot find the file to include or instantiate the object.

Artio Booking is not compatible with Joomla 3.3.6

errors in Artio Booking with Joomla 3.3.6
Fatal error: Declaration of TableReservation::bind() must be
compatible with JTableInterface::bind($src, $ignore = Array)
Fatal error: Declaration of TableSubject::store() must be compatible
with JTableInterface::store($updateNulls = false)
Ok, After some internal plugin coding, I managed to fix this issue.
Replace your files with these in administrator\components\com_booking\tables
Note : Please take a backup before proceeding.
Download
As the error tells you should change function parameter as there in the error -
You should edit your file(inside table folder of component) which has definition of TableReservation class and search for bind function and change
function bind()
to
function bind($src, $ignore = Array)
similarly search for TableSubject class and there change
function store()
to
function store($updateNulls = false)
You should also check on the component site if they provide update.There might be more errors once you fix this.

Fatal error: Call to undefined method Zend_XmlRpc_Value::getGenerator() magento

I was upgrading magento when something went wrong and now when I try to login to admin, I am unable to log in to back end admin of magento and I get the following error
Fatal error: Call to undefined method Zend_XmlRpc_Value::getGenerator() in /home/boutique/public_html/app/code/core/Zend/XmlRpc/Request.php on line 413
and the code on respective lines is
/**
* Create XML request
*
* #return string
*/
public function saveXml()
{
$args = $this->_getXmlRpcParams();
$method = $this->getMethod();
$generator = Zend_XmlRpc_Value::getGenerator();
$generator->openElement('methodCall')
->openElement('methodName', $method)
->closeElement('methodName');
I cant understand why this issue is happening, I tried replacing request.php and response.php files from fresh download of magento..
can body help me? why this eror is popping?
There's something about your installation of PHP and Magento that's broken — for some reason the Zend_XmlRpc_Value object that's instantiated doesn't contain a getGenerator method. The class for this object is normally defined in
lib/Zend/XmlRpc/Value.php
However, it's possible there may be a class override in place at
app/code/core/Zend/XmlRpc/Value.php
app/code/community/Zend/XmlRpc/Value.php
app/code/local/Zend/XmlRpc/Value.php
It's also possible your system may have another version of the zend framework installed somewhere in the PHP include path.

Magento: what did I break? "Fatal error: Call to a member function insert()" (version 1.4.1.1)

I was trying to implement some new functionality, decided not to, tried to roll back, and now am stuck with this error:
Fatal error: Call to a member function insert() on a non-object in /app/code/core/Mage/Core/Model/Mysql4/Resource.php on line 96
The functionality I mentioned seems simple enough (remove a couple links from the customer account sidebar), and I believe I've removed the 3 files and the edit to local.xml, but just for full view on things, here's exactly what i did.
Add'l info: I've got one custom module in place that I built for this site, and it was working prior to this glitch, but I'm wondering if something got screwed up in there maybe? (And I'm also thinking I might not have committed my last/working change, and now I'm in "doubt" territory about whether I screwed that up. It's a simple one though: 1 controller, 1 route.)
I've got no access to PHP error logs or the shell (exec() works great though), and the /var/system.log isn't adding anything more on my subsequent page-refreshes. And so this is where I'm stuck - Got any ideas on how to track this down? Thanks in advance!
Edit / here's the function that's throwing the error:
function setDbVersion($resName, $version)
{
$dbModuleInfo = array(
'code' => $resName,
'version' => $version,
);
if ($this->getDbVersion($resName)) {
self::$_versions[$resName] = $version;
$condition = $this->_write->quoteInto('code=?', $resName);
return $this->_write->update($this->_resTable, $dbModuleInfo, $condition);
}
else {
self::$_versions[$resName] = $version;
// this is line 96:
return $this->_write->insert($this->_resTable, $dbModuleInfo);
}
}

Fatal error with Custom Magento Module on one server but not the other

I am creating my own custom module in Magento and during testing on a Litespeed server (PHP v5.2.14) I am getting a Fatal Error: Call to a member function batch() on a non-object in ../../../BatchController.php on line 25 that was not appearing during testing on another linux server and a wamp server (PHP v5.2.11).
This one has stumped me. I am guessing it has something to do with the server configuration rather than the code itself. But i am just guessing. I was hoping someone here could tell me.
The only real major difference I could see, aside from the php versions and environment, is that the server that the error is on is using the Suhosin Patch. But would that be something that could cause this?
The line in question is Mage::getModel('mymodule/mymodel')->batch(); which is enclosed in an IF statement. batch() is a public function located in my model file.
If you need more code let me know.
Thanks!
If you get a "non-object" error when calling a model, there's a problem with Magento's attempt to get your model class, and it is returning null. The reasons for this are not always apparent. If this worked identically on a normal LAMP stack, then the problem is most likely not in your code.
My first guess would be that the file does not have the proper permissions. Otherwise, it may have to do with resolving the classname. You could test this temporarily by calling the plugin directly like this:
$obj = new Mynamespace_Mymodule_Model_Mymodel();
$obj->batch();
If this works, then the file is readable, and you will want to go spelunking in the resolution of that classname. If it doesn't work, you have a problem with either autoloading or the declaration of your class.
Hope that helps!
Thanks,
Joe
Break it down.
You've tried to call
Mage::getModel('mymodule/mymodel')->batch();
and PHP told you it tried to call the method batch on a non-object. That means
Mage::getModel('mymodule/mymodel')
isn't returning a Model object the way it's supposed to.
First thing to do is clear out your Magento cache on the server you're having problems with. If your Module's config hasn't been loaded into the global config tree Magento will try to instantiate a Mage_Core_Model_Mymodel, and fail.
Second step is to make sure your module's app/etc/module file is in place.
Third step is to add some debugging (assuming a 1.4 branch) to the method that instantiates your objects and determine why Magento can't create your object
File: app/code/core/Mage/Core/Model/Config.php
...
public function getModelInstance($modelClass='', $constructArguments=array())
{
$className = $this->getModelClassName($modelClass);
if (class_exists($className)) {
Varien_Profiler::start('CORE::create_object_of::'.$className);
$obj = new $className($constructArguments);
Varien_Profiler::stop('CORE::create_object_of::'.$className);
return $obj;
} else {
#throw Mage::exception('Mage_Core', Mage::helper('core')->__('Model class does not exist: %s.', $modelClass));
return false;
}
}
...

Categories