Reminder: Change Magento`s default phone numbers and callouts before site launch

Ok, finally fixed it.

This is a Magento bug, both with the notification rss feeds, and the logic behind checking whether Magento already has downloaded them or not. You can check the feeds manually here: http://notifications.magentocommerce.com/community/notifications.rss - and you’ll notice most of them have xml tags, in particular the ‘link’ tag. However, the annoying reminder “Reminder: Change Magento`s default phone numbers and callouts before site launch” does not have a link value, which is the problem.

When a feed is updated in the database, table ‘adminnotification_inbox’, the columns ‘is_read’, ‘is_remove’ and ‘url’ are updated. In the annoying message case, the ‘url’ column is updated with NULL (or left as empty if the message has not been touched). The code iterates through all feed items, and looks in the database if it has an item already based on it’s url. If the url matches it will not be inserted into the database. However, in this case, the url is NULL so the code fails and the same notification is inserted into the table.

The solution is simple:
1. Copy the file app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php to app/code/local/Mage/AdminNotification/Model/Resource
2. Modify line 102, from:

$select $adapter->select()
                ->
from($this->getMainTable())
                ->
where('url=?'$item['url']);

to

$select $adapter->select()
                ->
from($this->getMainTable())
                ->
where('url=? OR url IS NULL'$item['url'])
                ->
where('title=?'$item['title']);
3. Delete all your notifications.

That’s it. Leave the admin for a little and log back in. You’ll see the notice has not come back.

Regards,
Michael.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值