Reminder: Change Magento`s default phone numbers and callouts before site launch
2012-04-25 16:11
302 查看
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:
to
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.
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.
相关文章推荐
- Change the default Phone ringtone and notification ringtone
- Several reasons of why TaxonomySession.DefaultKeywordsTermStore and DefaultSiteCollectionTermStore c
- Why no effects when change the "Site Master Page Settings" from "Site Actions - Site Settings - Look and Feel - Master Page"?
- Validate and Format North American Phone Numbers (验证和格式化北美电话号码)
- How to Change the Order Increment ID and Prefix in Magento
- PS PIA Change Default Content and Layout
- change MySQL's config file and let it use utf-8 by default
- JDK Environment Variable And Change default JDK
- magento sitemap cms page remove home and generate sitemap error
- Change Default User and Password for Cognos Content Database
- magento -- 推荐插件 -- 智能版Js和Css合并 --Lesti::Merge(Smart Merging of Js and Css)
- hidden phone icon, and using sip phone instand ...
- Getting things in Magento by getModel and getData methods
- Enumerate and Change Display Modes
- 【简单题】【数学】-CF-397B-On Corruption and Numbers
- How to Change the Icon for a File Type in Windows 7 and Vista(转)
- Codeforces Round #361 (Div. 2) A. Mike and Cellphone
- how to extract and decrypt WeChat EnMicromsg.db on Android phone
- LeetCode OJ Bitwise AND of Numbers Range
- hdoj 5505 GT and numbers 【判断一个数 能否通过累乘因子得到另一个数】【好题】