Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6170271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:00:12+00:00 2026-05-23T23:00:12+00:00

I am following this tutorial http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-5-magento-models-and-orm-basics . As per this tutorial,when i pass a

  • 0

I am following this tutorial
http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-5-magento-models-and-orm-basics.

As per this tutorial,when i pass a value with url like(http://localhost/dev/weblog/index/testModel/id/1), I am getting error like this

Fatal error: Call to a member function load() on a non-object in app\code\local\Srivats\Weblog\controllers\IndexController.php on line 10

This is my index controller code

<?php
class Srivats_Weblog_IndexController extends Mage_Core_Controller_Front_Action
{
    public function testModelAction()
    {
        $params = $this->getRequest()->getParams();
        $blogpost = Mage::getModel('weblog/blogpost');
        echo("Loading the blogpost with an ID of ".$params['id']);
        $blogpost->load($params['id']);
        $data = $blogpost->getData();
        var_dump($data);
    }
}

Blogpost.php file

<?php
class Srivats_Weblog_Model_Mysql4_Blogpost extends Mage_Core_Model_Mysql4_Abstract
{
    protected function _construct()
    {
        $this->_init('weblog/blogpost','blogpost_id');
    }
}

Here is my config file

<?xml version="1.0" encoding="utf-8"?>
        <config>
            <global>
                <modules>
                    <srivats_weblog>
                        <version>1.0.0</version>
                    </srivats_weblog>
                </modules>
                <models>
                    <weblog_mysql4>
                        <class>Srivats_Weblog_Model_Mysql4</class>
                        <resourceModel>weblog_mysql4</resourceModel>
                    </weblog_mysql4>
                </models>
            </global>
            <frontend>
                <routers>
                    <weblog>
                        <use>standard</use>
                        <args>
                            <module>Srivats_Weblog</module>
                            <frontName>weblog</frontName>
                        </args>
                    </weblog>
                </routers>
            </frontend>
        </config>

system.log shows

Warning: include() [function.include]:
Failed opening ‘Mage\Weblog\Model\Blogpost.php’ for inclusion
(include_path=’app\code\local;E:\dev\app\code\community;app\code\core;E:\dev\lib;.;C:\php\pear’)
in lib\Varien\Autoload.php on line 93

Here is the link to all files https://gist.github.com/cf99e4277599954f38d4
I think this line $blogpost->load($params['id']); causing trouble.What i am missing.Any pointers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:00:13+00:00Added an answer on May 23, 2026 at 11:00 pm

    Ahh in you config you should have

    <global>
        <models>
            <weblog>
                <class>Srivats_Weblog_Model</class>
                <resourceModel>weblog_mysql4</resourceModel>
            </weblog>
        </model>
    </global>
    

    you already have for mysql4 resource add this on top of that. You should have

                <models>
                    <weblog>
                      <class>Srivats_Weblog_Model</class>
                      <resourceModel>weblog_mysql4</resourceModel>
                    </weblog>
                    <weblog_mysql4>
                        <class>Srivats_Weblog_Model_Mysql4</class>
                    </weblog_mysql4>
                </models>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://www.codinghorror.com/blog/2008/04/setting-up-subversion-on-windows.html I am following this as a guide to install subversion. The tutorial at
I was following this tutorial: http://www.marcofolio.net/webdesign/a_fancy_apple.com-style_search_suggestion.html And checking out the demo here: http://qpoit.com/marcofolio_demo/apple_search/ I
I am following this tutorial: http://www.csharp-station.com/Tutorials/Lesson01.aspx I pasted this into a text file, named
I am following this tutorial :- http://blogs.oracle.com/enterprisetechtips/entry/true_abstraction_composite_ui_components But it's not working for me. This
I am following this tutorial http://www.codeproject.com/KB/cpp/authforwebservices.aspx They have this in the tutorial [SoapHeader(Authentication, Required
I'm following this tutorial on Flash Pro CS4: http://www.baycongroup.com/flashCS4/09_flashCS4.html I have a button. I
I have been following this tutorial series for OpenGL : GLUT : http://www.lighthouse3d.com/opengl/glut/ I
I'm following this tutorial on creating buttons with CSS. http://www.secondpicture.com/tutorials/web_design/css_ul_li_horizontal_css_menu.html The background for the
I am following this tutorial: http://www.codeproject.com/KB/android/AndroidSQLite.aspx I must be overthinking this SQLite stuff (in
I am following the C programming tutorial at http://www.cprogramming.com/tutorial/c/lesson10.html . This particular tutorial teaches

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.