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 7590485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:24:47+00:00 2026-05-30T20:24:47+00:00

I am new to magento. I am trying to write module to report abuse

  • 0

I am new to magento. I am trying to write module to report abuse about site.I have the form on below page.

http://localhost/magento/vendorinfo/page/report/

Module name is vendorinfo, controller is page and action is report. Below is my ReportAction which has taken from my Venderinfo module

    public function reportsubmitAction() {
       $data = $this->getRequest()->getParams();
 try {

            $insert_data = array();
            $insert_data['reporter_name']    = $data['name'];
            $insert_data['reporter_email']   = $data['email'];
            $insert_data['report_category']  = $data['category_type'];
            $insert_data['reporter_comment'] = $data['report_comments'];


            $model = Mage::getModel('vendorinfo/report'); 
            $model->setData($insert_data)->setId(null);  // i have got the error on this line
            $model->setCreatedTime(now())->setUpdateTime(now());
            $model->save();

            Mage::getSingleton('frontend/session')->addSuccess(Mage::helper('articles')->__('Report was successfully submitted'));
            Mage::getSingleton('frontend/session')->setFormData(false);
        } catch (Exception $e) {
            Mage::getSingleton('frontend/session')->addError($e->getMessage());
            Mage::getSingleton('frontend/session')->setFormData($data);
            $this->_redirect('vendorinfo/page/report', array());
            return;
        }

    }

When i submit the form i called the above action to store my data to DB. But i ‘ve got this below error,

Fatal error: Call to a member function getIdFieldName() on a
non-object in
C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Abstract.php on
line 151

Also i have create the 2 model files under the following folder structure,

1. Venderinfo/Model/Report.php

class Comp_Vendorinfo_Model_Report extends Mage_Core_Model_Abstract
{
    public function _construct()
    {
        parent::_construct();
        $this->_init('vendorinfo/report_abuse');

    }
}

2.Venderinfo/Model/Mysql4/Report/Collection.php

   class Comp_Vendorinfo_Model_Mysql4_Report_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
    {
        public function _construct()
        {
            parent::_construct();
            $this->_init('vendorinfo/report_abuse');
        }
    }

What i done wrong on this?

Kindly advice on this.

  • 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-30T20:24:49+00:00Added an answer on May 30, 2026 at 8:24 pm

    You need to create a resource model Venderinfo/Model/Mysql4/Report.php and declare it in your config. In your database table, you should have an ID field such as report_id, and this name must be defined in the constructor of the resource model.

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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add new columns in Magento's Products Ordered report. I have added
I'm implementing a new template for a Magento site. I have issues with categories
I am trying to add a new payment module into Magento. However, even after
I'm new in Magento and I'm trying to make a layout for a module
I am trying to create a new module for Magento that is only visible
I am trying to create a new custom module in magento but the layout
I am trying to create a custom module in magento admin. I have reached
Thanks in advance. I am new to Magento, and I have created a module
I have a product page in a Magento store and I'm trying to implement
I am new to Magento and what I am trying to produce is the

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.