All the sudden in the admin side when I go to submit sitemap it shows up a white screen. Here's what my error logs show.
PHP Fatal error: Call to a member function getId() on a non-object in /home/investor/public_html/yourvaporizers.com/app/code/core/Mage/Adminhtml/controllers/SitemapController.php on line 99
PHP Fatal error: Call to a member function getCollection() on a non-object in /home/investor/public_html/yourvaporizers.com/includes/src/Mage_Adminhtml_Block_Sitemap_Grid.php on line 47
Not a coder so have no clue how to fix this.
UPDATE - I should of added the whole error code.
Stack trace:
0 /home/investor/public_html/yourvaporizers.com/includes/src/__default.php(63823): PDOStatement->execute(Array)
1 /home/investor/public_html/yourvaporizers.com/includes/src/Varien_Db_Statement_Pdo_Mysql.php (110): Zend_Db_Statement_Pdo->_execute(Array)
2 /home/investor/public_html/yourvaporizers.com/includes/src/__default.php(63411): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
3 /home/investor/public_html/yourvaporizers.com/includes/src/__default.php(52806): Zend_Db_Statement->execute(Array)
4 /home/investor/public_html/yourvaporizers.com/includes/src/__default.php(53842): Zend_Db_Adapter_Abstract->query('SELECT `mg_core...', Array)
5 /home/investor/public_html/yourvaporizers.com/includes/src/__default.php(54687): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `mg_core...', Array)
6 /home/investor/p in /home/investor/public_html/yourvaporizers.com/includes/src/__default.php on line 63829
[07-Apr-2014 07:51:25 UTC] PHP Fatal error: Call to a member function getCollection() on a non-object in /home/investor/public_html/yourvaporizers.com/includes/src/Mage_Adminhtml_Block_Sitemap_Grid.php on line 47
[07-Apr-2014 07:51:28 UTC] PHP Fatal error: Call to a member function getId() on a non-object in /home/investor/public_html/yourvaporizers.com/app/code/core/Mage/Adminhtml/controllers/SitemapController.php on line 99
[07-Apr-2014 07:51:32 UTC] PHP Fatal error: Call to a member function getCollection() on a non-object in /home/investor/public_html/yourvaporizers.com/includes/src/Mage_Adminhtml_Block_Sitemap_Grid.php on line 47
[07-Apr-2014 08:07:18 UTC] PHP Fatal error: Call to a member function getCollection() on a non-object in /home/investor/public_html/yourvaporizers.com/includes/src/Mage_Adminhtml_Block_Sitemap_Grid.php on line 47
[07-Apr-2014 10:03:37 UTC] PHP Fatal error: Class 'Mage_Sitemap_Model_Sitemap' not found in /home/investor/public_html/yourvaporizers.com/app/code/community/Creare/CreareSeoCore/Model/Sitemap/Sitemap.php on line 4
Here's line 99 of that file
#File: app/code/core/Mage/Adminhtml/controllers/SitemapController.php
$this->_title($model->getId() ? $model->getSitemapFilename() : $this->__('New Sitemap'));
So, it looks like Magento is trying to call getId on the $model variable, but $model is not an object. If we look to where $model was assigned/defined, in a stock system, we see
#File: app/code/core/Mage/Adminhtml/controllers/SitemapController.php
$model = Mage::getModel('sitemap/sitemap');
So, there's two possible reasons for your error. First, you, or someone else, installed an extension into your Magento system and it did something (class rewrite, behavior change) that caused a recoverable error when attempting to instantiate the sitemap/sitemap model. This results in $model being false, and leads to your error.
The second is someone has change this file or the site map model file (either in core or one of the code pools community, local) and did something that leads to $model being undefined.
Debugging steps would include diffing against a freshly downloaded copy, and disabling any extensions related to the site map functionality (or installed recently). As for
Not a coder so have no clue how to fix this.
the better question might be
Why is a non-coder working with a system that, for years, has proven you need to be a coder (or willing to learn) to work with.
Related
I am trying to write a script that creates configurable products. Ive been using this as a guide: http://inchoo.net/magento/programmatically-create-a-configurable-magento-product/
When I get to this line:
$configurableAttributesData = $configProduct->getTypeInstance()->getConfigurableAttributesAsArray();
The script crashes and kicks out this error:
Fatal error: Call to a member function getId() on a non-object in /home/buyfrom/public_html/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php on line 283
Following a comment on this page, I changed that line to the following:
$possibleAttributes = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product);
But I am still getting this error. Can anyone suggest how to fix this?
Make sure that attribute set (eg. default) which you are choosing is having at least one configurable attribute (example: 'color' or 'size').
I'm attempting to run a php script to parse Google Calendar XML and I keep getting the following error:
Call to a member function asXML() on a non-object in /index.php on line 120
Here's a link to my code (I've notated Line 120 - IT IS LINE 38 ON PASTEBIN) http://pastebin.com/bMHXfbkD
Anybody with any ideas / fixes would be much appreciated!
UPDATE #Clover and #Phil have suggested I remove the line in question, which I did, and got this:
Notice: Trying to get property of non-object in /Library/WebServer/Documents/index2.php on line 125
Warning: Invalid argument supplied for foreach() in /Library/WebServer/Documents/index2.php on line 125
simplexml_load_file function can return FALSE, so make a test before using it.
By the way, in your case, just remove the line, it does nothing :)
use try catch, and instead of using Exception class, try Throwable class
I am new to opencart, so please help me.
I am using opencart version 1.5.6, now whenever I edit and delete the product it shows me
Fatal error: Call to a member function productUpdateListen() on a non-object in /home/crazepur/public_html/admin/controller/catalog/product.php on line 78
and
Fatal error: Call to a member function deleteProduct() on a non-object in /home/crazepur/public_html/admin/controller/catalog/product.php on line 133 respectively.
Although it edit and delete the product.
Please help me how to fix it.
Code in Line 78 $this->openbay->productUpdateListen($this->request->get['product_id'], $this->request->post);
And code in line 133 $this->openbay->deleteProduct($product_id);
This means $this->openbay is not an object which contains function productUpdateListen() & deleteProduct(), probably it's NULL or false in some cases (nothing found) due to it's not accessible. Out of scope.
Try
var_dump($this->openbay);
Check the O/P
it's simple and the error-message says it all: your $this->openbay doesn't have those methods (productUpdateListen() and deleteProduct()) - most likely it isn't an object at all.
please debug your code since it's impossible to say what's going wrong wich so little information. to start, do a var_dump($this->openbay); right before the function-calls and check the output.
I had magento site which was based on community edition 1.5 when i upgraded it to 1.7 the error came up : "Call to a member function getAllOptions() on a non-object..."
Have tried almost every solution but couldn't make it working.
The full error-message is:
Call to a member function getAllOptions() on a non-object in /site-path/app/code/core/Mage/Core/Model/Cache.php on line 434
Is your webshop using Aitoc Extensions ?
http://www.magentocommerce.com/boards/viewthread/279027/
You need to re-install or upgrade the extensions but what you can do in the meanwhile is:
comment App/Mage.php line 198
//self::$_appRoot = null;
Because this line is called on:
app/code/core/Mage/Core/Model/Config/Options.php line 54:
Hope it helps!
Fatal error: Call to a member function getAllOptions() on a
non-object. In the file app/code/core/Mage/Core/Model/Cache.php.
comment App/Mage.php line 198
//self::$_appRoot = null;
when I call a specifical controller-script of my Web-Application I sporadically get the following error:
Fatal error: Call to a member function allow() on a non-object in /srv/www/vhost/app/Controller/myController.php on line 11
Line 11 contains
$this->Auth->allow(array('get'));
Anyone an idea what this may cause?
Regards,
~MxAgent
Problem fixed. It was a caching-problem due to server doesn't support APC.