Skip to content

Commit 2850bdb

Browse files
author
Marc Bernabeu
committed
fix column read
1 parent c0c8035 commit 2850bdb

5 files changed

Lines changed: 22 additions & 4 deletions

File tree

app/code/community/Devopensource/Notification/Block/Adminhtml/Notifications.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function getMessage()
1414
{
1515

1616
$notification = Mage::getModel('devopennotify/notification')->getCollection()
17-
->addFieldToFilter('read', 0);
17+
->addFieldToFilter('is_read', 0);
1818

1919
return $notification;
2020
}

app/code/community/Devopensource/Notification/controllers/Adminhtml/NotifyController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function _readNotification ($idNotification){
3131
// Guardamos la notificacion en variable para poder ser usada en la funcion _readNotificationInbox
3232
$this->_notification = $notification;
3333

34-
$notification->setRead(1);
34+
$notification->setIsRead(1);
3535
$notification->save();
3636
}
3737

app/code/community/Devopensource/Notification/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<config>
33
<modules>
44
<Devopensource_Notification>
5-
<version>0.1.0</version>
5+
<version>0.1.1</version>
66
</Devopensource_Notification>
77
</modules>
88
<global>

app/code/community/Devopensource/Notification/sql/devopennotify_setup/install-0.1.0.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
->addColumn('url', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
3939
'nullable' => true,
4040
), 'url')
41-
->addColumn('read', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
41+
->addColumn('is_read', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
4242
'nullable' => false,
4343
'default' => 0
4444
), 'read')
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/* @var $installer Mage_Core_Model_Resource_Setup */
3+
4+
$installer = $this;
5+
6+
$installer->startSetup();
7+
8+
try{
9+
$installer->getConnection()->changeColumn($installer->getTable('devopennotify/notification'),'read','is_read',array(
10+
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
11+
'nullable' => false,
12+
'default' => 0
13+
));
14+
}catch(Exception $e){
15+
16+
}
17+
18+
$installer->endSetup();

0 commit comments

Comments
 (0)