Reminder: Magento`s default phone numbers and callouts need to be changed before site launch

If you are getting any SQL error message like, SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘Reminder: Change Magento`s default phone numbers and callouts be’ for key ‘title’ or just want to get rid of the Admin Notifications thing, then here is the workaround for that : Copy the file: MAGENTO/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php to MAGENTO/app/code/local/Mage/AdminNotification/Model/Resource If the directories do not exist, create them, manually. Edit the file MAGENTO/app/code/local/Mage/AdminNotification/Model/Resource/Inbox.php Find this : --------------------------------------
public function parse(Mage_AdminNotification_Model_Inbox $object, array $data)
    {
        $adapter = $this->_getWriteAdapter();
        foreach ($data as $item) {
            $select = $adapter->select()
                ->from($this->getMainTable())
                ->where('title = ?', $item['title']);
            if (empty($item['url'])) {
                $select->where('url IS NULL');
            } else {
                $select->where('url = ?', $item['url']);
            }
            if (isset($item['internal'])) {
                $row = false;
                unset($item['internal']);
            } else {
                $row = $adapter->fetchRow($select);
            }
            if (!$row) {
                $adapter->insert($this->getMainTable(), $item);
            }
        }
    }
}
--------------------------------------------------------------
Replace with this:
-------------------------------------------------------------
public function parse(Mage_AdminNotification_Model_Inbox $object, array $data)
   {
       $adapter = $this->_getWriteAdapter();
       foreach ($data as $item) {
           $select = $adapter->select()
                     ->from($this->getMainTable())
                     ->where('url=? OR url IS NULL', $item['url'])
                     ->where('title=?', $item['title']);
           }
           if (isset($item['internal'])) {
               $row = false;
               unset($item['internal']);
           } else {
               $row = $adapter->fetchRow($select);
           }
           if (!$row) {
               $adapter->insert($this->getMainTable(), $item);
           }
       }
   }

Site Search

Contact Us

 
 
 
Parent Technology Inc.
1535 Rosalind Rd Se
East Grand Rapids, MI 49506, USA
 
 

This email address is being protected from spambots. You need JavaScript enabled to view it.