Magento: change default phone numbers before site launch

Magento Error: change default phone numbers before site launch

By Jonathan on March 1, 2012

We’ve come across this Magento error a few times in the past since the latest update to version At first the message: “Reminder: Change Magento`s default phone numbers and callouts before site launch” Does not act like an error, it is only when we go to delete/read the message we see that the message still remains and a the same message then reappears unread.

The reason this occurs is because there is no ‘link’ tag within the notifications.rss, unlike all of the other notifications. When the user views their messages Magento checks the table ‘adminnotification_inbox’ to see if the columns ‘is_read’, ‘is_removed’ and ‘url’ have been updated. In this case the ‘url’ column is updated with NULL when read. When Magento checks the database for messages it checks to see if there is an item already based on it’s url. Furthermore, if the the url matches it will not be inserted into the database. However when the field is null, like in this case, the code will fail and the same notification will be inserted into the table.

There is a fairly simple solution to fix this. You must have access to the Magento core files to fix this.

Firstly make a copy of the file app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php to your desktop.

Next modify this file from line 102
{code type=php}
$select = $adapter->select()
->where(‘url=?’, $item[‘url’]);


{code type=php}
$select = $adapter->select()
->where(‘url=? OR url IS NULL’, $item[‘url’])
->where(‘title=?’, $item[‘title’]);

Then put that file back into its new location at app/code/local/Mage/AdminNotification/Model/Resource. If any of these folders are not there, create them.

Next log in to your Magento admin area and delete all your notifications.

Should be all sorted then!

Happy coding!

Falkon blog post featured image for post - WordPress Templates

WordPress Templates

Ever wanted to customise a single page in WordPress with the template system but never knew how? Its simple with...