diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index b3c10b1cfa..9ffd989597 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1312,7 +1312,7 @@ function get_schema_struct() 'user_id' => array('UINT', 0), 'notification_read' => array('BOOL', 0), 'notification_time' => array('TIMESTAMP', 1), - 'data' => array('TEXT_UNI', ''), + 'notification_data' => array('TEXT_UNI', ''), ), 'PRIMARY_KEY' => 'notification_id', 'KEYS' => array( diff --git a/phpBB/includes/notification/type/base.php b/phpBB/includes/notification/type/base.php index cdca9aa642..c262fbeedb 100644 --- a/phpBB/includes/notification/type/base.php +++ b/phpBB/includes/notification/type/base.php @@ -110,7 +110,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i { // The row from the database (unless this is a new notification we're going to add) $this->data = $data; - $this->data['data'] = (isset($this->data['data'])) ? unserialize($this->data['data']) : array(); + $this->data['notification_data'] = (isset($this->data['notification_data'])) ? unserialize($this->data['notification_data']) : array(); } public function __get($name) @@ -137,7 +137,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i */ protected function get_data($name) { - return ($name === false) ? $this->data['data'] : ((isset($this->data['data'][$name])) ? $this->data['data'][$name] : null); + return ($name === false) ? $this->data['notification_data'] : ((isset($this->data['notification_data'][$name])) ? $this->data['notification_data'][$name] : null); } /** @@ -148,7 +148,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i */ protected function set_data($name, $value) { - $this->data['data'][$name] = $value; + $this->data['notification_data'][$name] = $value; } /** @@ -171,12 +171,12 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i 'notification_time' => time(), 'notification_read' => false, - 'data' => array(), + 'notification_data' => array(), ), $this->data); $data = $this->data; - $data['data'] = serialize($data['data']); + $data['notification_data'] = serialize($data['notification_data']); return $data; } diff --git a/phpBB/includes/notification/type/post.php b/phpBB/includes/notification/type/post.php index f29372923e..ddfa720e5e 100644 --- a/phpBB/includes/notification/type/post.php +++ b/phpBB/includes/notification/type/post.php @@ -342,7 +342,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base // Do not add them as a responder if they were the original poster that created the notification if ($this->get_data('poster_id') == $post['poster_id']) { - return array('data' => serialize($this->get_data(false))); + return array('notification_data' => serialize($this->get_data(false))); } $responders = $this->get_data('responders'); @@ -354,7 +354,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base // Do not add them as a responder multiple times if ($responder['poster_id'] == $post['poster_id']) { - return array('data' => serialize($this->get_data(false))); + return array('notification_data' => serialize($this->get_data(false))); } } @@ -365,6 +365,6 @@ class phpbb_notification_type_post extends phpbb_notification_type_base $this->set_data('responders', $responders); - return array('data' => serialize($this->get_data(false))); + return array('notification_data' => serialize($this->get_data(false))); } } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 364eca9267..ed1c6ee847 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1200,7 +1200,7 @@ function database_update_info() 'notification_read' => array('BOOL', 0), 'is_enabled' => array('BOOL', 1), 'notification_time' => array('TIMESTAMP', 1), - 'data' => array('TEXT_UNI', ''), + 'notification_data' => array('TEXT_UNI', ''), ), 'PRIMARY_KEY' => 'notification_id', 'KEYS' => array( diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index bb4e413ba1..260b75947a 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -636,7 +636,7 @@ CREATE TABLE phpbb_notifications ( user_id INTEGER DEFAULT 0 NOT NULL, notification_read INTEGER DEFAULT 0 NOT NULL, notification_time INTEGER DEFAULT 1 NOT NULL, - data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL + notification_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; ALTER TABLE phpbb_notifications ADD PRIMARY KEY (notification_id);; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 1fa3616857..aa9766f91f 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -780,7 +780,7 @@ CREATE TABLE [phpbb_notifications] ( [user_id] [int] DEFAULT (0) NOT NULL , [notification_read] [int] DEFAULT (0) NOT NULL , [notification_time] [int] DEFAULT (1) NOT NULL , - [data] [varchar] (4000) DEFAULT ('') NOT NULL + [notification_data] [varchar] (4000) DEFAULT ('') NOT NULL ) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 8163b7a051..ebadc93f05 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -447,7 +447,7 @@ CREATE TABLE phpbb_notifications ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, notification_read tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, notification_time int(11) UNSIGNED DEFAULT '1' NOT NULL, - data blob NOT NULL, + notification_data blob NOT NULL, PRIMARY KEY (notification_id), KEY item_ident (item_type, item_id), KEY user (user_id, notification_read) diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 6654734ab8..ff46c13fef 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -447,7 +447,7 @@ CREATE TABLE phpbb_notifications ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, notification_read tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, notification_time int(11) UNSIGNED DEFAULT '1' NOT NULL, - data text NOT NULL, + notification_data text NOT NULL, PRIMARY KEY (notification_id), KEY item_ident (item_type, item_id), KEY user (user_id, notification_read) diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index a65fe63167..7a285c6d55 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -862,7 +862,7 @@ CREATE TABLE phpbb_notifications ( user_id number(8) DEFAULT '0' NOT NULL, notification_read number(1) DEFAULT '0' NOT NULL, notification_time number(11) DEFAULT '1' NOT NULL, - data clob DEFAULT '' , + notification_data clob DEFAULT '' , CONSTRAINT pk_phpbb_notifications PRIMARY KEY (notification_id) ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 504ffe8282..1035dd1ce8 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -619,7 +619,7 @@ CREATE TABLE phpbb_notifications ( user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), notification_read INT2 DEFAULT '0' NOT NULL CHECK (notification_read >= 0), notification_time INT4 DEFAULT '1' NOT NULL CHECK (notification_time >= 0), - data varchar(4000) DEFAULT '' NOT NULL, + notification_data varchar(4000) DEFAULT '' NOT NULL, PRIMARY KEY (notification_id) ); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 836d0a0bd0..3586a9040d 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -434,7 +434,7 @@ CREATE TABLE phpbb_notifications ( user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', notification_read INTEGER UNSIGNED NOT NULL DEFAULT '0', notification_time INTEGER UNSIGNED NOT NULL DEFAULT '1', - data text(65535) NOT NULL DEFAULT '' + notification_data text(65535) NOT NULL DEFAULT '' ); CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (item_type, item_id); diff --git a/tests/notification/notification.php b/tests/notification/notification.php index 34b8423689..e7fd8539ab 100644 --- a/tests/notification/notification.php +++ b/tests/notification/notification.php @@ -206,8 +206,8 @@ class phpbb_notification_test extends phpbb_database_test_case 'item_parent_id' => 1, 'user_id' => 0, 'notification_read' => 0, - 'notification_time' => 1349413321, - 'data' => array(), + 'notification_time' => 1349413321, + 'notification_data' => array(), ), 2 => array( 'item_type' => 'test', @@ -215,8 +215,8 @@ class phpbb_notification_test extends phpbb_database_test_case 'item_parent_id' => 2, 'user_id' => 0, 'notification_read' => 0, - 'notification_time' => 1349413322, - 'data' => array(), + 'notification_time' => 1349413322, + 'notification_data' => array(), ), 3 => array( 'item_type' => 'test', @@ -224,8 +224,8 @@ class phpbb_notification_test extends phpbb_database_test_case 'item_parent_id' => 2, 'user_id' => 0, 'notification_read' => 0, - 'notification_time' => 1349413323, - 'data' => array(), + 'notification_time' => 1349413323, + 'notification_data' => array(), ), 4 => array( 'item_type' => 'post', @@ -233,8 +233,8 @@ class phpbb_notification_test extends phpbb_database_test_case 'item_parent_id' => 2, 'user_id' => 0, 'notification_read' => 0, - 'notification_time' => 1349413324, - 'data' => array( + 'notification_time' => 1349413324, + 'notification_data' => array( 'poster_id' => 2, 'topic_title' => 'test-title', 'post_subject' => 'Re: test-title', @@ -248,9 +248,9 @@ class phpbb_notification_test extends phpbb_database_test_case 'item_id' => 5, 'item_parent_id' => 2, 'user_id' => 0, - 'notification_read' => 0, - 'notification_time' => 1349413325, - 'data' => array( + 'notification_read' => 0, + 'notification_time' => 1349413325, + 'notification_data' => array( 'poster_id' => 2, 'topic_title' => 'test-title', 'post_subject' => 'Re: test-title', @@ -313,7 +313,7 @@ class phpbb_notification_test extends phpbb_database_test_case 'user_id' => 0, 'notification_read' => 0, 'notification_time' => 1349413321, - 'data' => array(), + 'notification_data' => array(), ), 2 => array( 'item_type' => 'test', @@ -322,7 +322,7 @@ class phpbb_notification_test extends phpbb_database_test_case 'user_id' => 0, 'notification_read' => 0, 'notification_time' => 1349413322, - 'data' => array(), + 'notification_data' => array(), ), 3 => array( 'item_type' => 'test', @@ -331,7 +331,7 @@ class phpbb_notification_test extends phpbb_database_test_case 'user_id' => 0, 'notification_read' => 0, 'notification_time' => 1234, - 'data' => array(), + 'notification_data' => array(), ), 4 => array( 'item_type' => 'post', @@ -340,7 +340,7 @@ class phpbb_notification_test extends phpbb_database_test_case 'user_id' => 0, 'notification_read' => 0, 'notification_time' => 1349413324, - 'data' => array( + 'notification_data' => array( 'poster_id' => 2, 'topic_title' => 'test-title', 'post_subject' => 'Re: test-title', @@ -356,7 +356,7 @@ class phpbb_notification_test extends phpbb_database_test_case 'user_id' => 0, 'notification_read' => 0, 'notification_time' => 1349413325, - 'data' => array( + 'notification_data' => array( 'poster_id' => 2, 'topic_title' => 'test-title2', 'post_subject' => 'Re: test-title2',