Page 8 of 11

Re: [BETA] [3.2] Prime Notify

Posted: Wed Jan 16, 2019 6:11 pm
by Komanche
3.2.5 on PHP 5.4.38 works like a charm...

Re: [BETA] [3.2] Prime Notify

Posted: Thu Jan 17, 2019 3:30 pm
by koraldon
3.2.5 using php 7.0.32 working great
Also I saw that phpbb 3.2.5 added list unsubscribe header - does it also added to prime notify?

Re: [BETA] [3.2] Prime Notify

Posted: Thu Jan 17, 2019 9:41 pm
by fagbutlil
3.2.5 and PHP version: 7.2.10 all good.

Re: [BETA] [3.2] Prime Notify

Posted: Thu Jan 17, 2019 11:58 pm
by horseguards
Great News!

I just tried Prime Notify on my phpBB 3.2.3 with PHP 7.2.14 and works fine. :D
Not so lucky with PrimeLinks, yet.

Thanks a lot!

Re: [BETA] [3.2] Prime Notify

Posted: Sat Jan 19, 2019 1:02 am
by CarolC1
primehalo wrote:
Wed Jan 02, 2019 10:02 pm
CarolC1 wrote:
Tue Jan 01, 2019 2:02 am
Thank you so much for making this. We've had this on 3.0 and 3.1, and this new 3.2 version installed on the 3.2.5 test board is working great. :D

I would really like to be able to use the new User's Choice options, which are a really nice feature, but is there a way to make our installation default to 'No' in the ucp when Always Notify is set on User's Choice in the acp? Personally, I plan to opt for 'Yes' in my settings, but I don't know if everybody would.

Thanks again! :D
That is set in the migrations/version_100.php file:

Code: Select all

	public function update_schema()
	{
		return array(
			'add_columns'	=> array(
				USERS_TABLE	=> array(
					'user_primenotify_enable_post'	=> array('BOOL', true),
					'user_primenotify_enable_pm'	=> array('BOOL', true),
					'user_primenotify_keep_bbcodes'	=> array('BOOL', true),
					'user_primenotify_always_send'	=> array('BOOL', true),
				),
			),
		
You can change user_primenotify_always_send to false before installing.
I'm getting an error trying to do this. I did it twice just to be sure. I was already running the ext so I disabled it, deleted the data, and deleted it out of the files. Then I downloaded a fresh zip file and edited migrations/version_100.php as you said (I hope),

Code: Select all

public function update_schema()
	{
		return array(
			'add_columns'	=> array(
				USERS_TABLE	=> array(
					'user_primenotify_enable_post'	=> array('BOOL', true),
					'user_primenotify_enable_pm'	=> array('BOOL', true),
					'user_primenotify_keep_bbcodes'	=> array('BOOL', true),
					'user_primenotify_always_send'	=> array('BOOL', false),
				),
			),
		);
	}
and uploaded the ext again. When I click to enable it, this is what it says. I'm thinking maybe I should just leave it alone, it is working a treat without this migrations/version_100.php edit. :)

Code: Select all

General Error
SQL ERROR [ mysql4 ]

Invalid default value for 'user_primenotify_always_send' [1067]

SQL

ALTER TABLE `****_users` ADD COLUMN `user_primenotify_always_send` tinyint(1) UNSIGNED DEFAULT '' NOT NULL

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 997
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mysql.php
LINE: 191
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/tools/tools.php
LINE: 1064
CALL: phpbb\db\driver\mysql->sql_query()

FILE: [ROOT]/phpbb/db/tools/tools.php
LINE: 1272
CALL: phpbb\db\tools\tools->_sql_run_sql()

FILE: [ROOT]/phpbb/db/tools/tools.php
LINE: 549
CALL: phpbb\db\tools\tools->sql_column_add()

FILE: (not given by php)
LINE: (not given by php)
CALL: phpbb\db\tools\tools->perform_schema_changes()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 714
CALL: call_user_func_array()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 661
CALL: phpbb\db\migrator->run_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 400
CALL: phpbb\db\migrator->process_data_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 288
CALL: phpbb\db\migrator->try_apply()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 241
CALL: phpbb\db\migrator->update_do()

FILE: [ROOT]/phpbb/extension/base.php
LINE: 78
CALL: phpbb\db\migrator->update()

FILE: [ROOT]/ext/primehalo/primenotify/ext.php
LINE: 83
CALL: phpbb\extension\base->enable_step()

FILE: [ROOT]/phpbb/extension/manager.php
LINE: 190
CALL: primehalo\primenotify\ext->enable_step()

FILE: [ROOT]/includes/acp/acp_extensions.php
LINE: 213
CALL: phpbb\extension\manager->enable_step()

FILE: [ROOT]/includes/functions_module.php
LINE: 676
CALL: acp_extensions->main()

FILE: [ROOT]/adm/index.php
LINE: 82
CALL: p_master->load_active()

Re: [BETA] [3.2] Prime Notify

Posted: Sat Jan 19, 2019 1:35 am
by primehalo
Your change looks correct to me. For some reason the boolean false value is being changed to the empty string (UNSIGNED DEFAULT '') instead of a zero (UNSIGNED DEFAULT 0). I have no idea why that would be happening.

Re: [BETA] [3.2] Prime Notify

Posted: Mon Jan 21, 2019 4:58 am
by CarolC1
I'm sorry for the delay. It won't matter, we're happy with it the way it is. :D Many thanks!

Re: [BETA] [3.2] Prime Notify

Posted: Sun Mar 24, 2019 10:48 am
by whocarez
Hello,
I think, that I found a small bug in notifications with unicode symbols/smilies.

Code: Select all

SQL ERROR [ mysqli ]

Incorrect string value: '\xF0\x9F\xA4\x94\xF0\x9F...' for column `forum`.`phpbb_notifications`.`notification_data` at row 1 [1366]

SQL

INSERT INTO phpbb_notifications (item_id, notification_type_id, item_parent_id, notification_time, notification_read, notification_data, user_id) VALUES (138452, 37, 98789, 1553423894, 0, 'a:7:{s:17:\"prime_notify_text\";s:432:\"\n removed  🤔🤗😂 removed \";s:9:\"poster_id\";i:53;s:11:\"topic_title\";s:56:\" removed \";s:12:\"post_subject\";s:60:\"Re: removed \";s:13:\"post_username\";s:0:\"\";s:8:\"forum_id\";i:23;s:10:\"forum_name\";s:7:\" removed \";}', 2043)

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 994
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mysqli.php
LINE: 193
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 656
CALL: phpbb\db\driver\mysqli->sql_query()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 377
CALL: phpbb\db\driver\driver->sql_multi_insert()

FILE: [ROOT]/phpbb/db/sql_insert_buffer.php
LINE: 138
CALL: phpbb\db\driver\factory->sql_multi_insert()

FILE: [ROOT]/phpbb/notification/method/board.php
LINE: 276
CALL: phpbb\db\sql_insert_buffer->flush()

FILE: [ROOT]/phpbb/notification/manager.php
LINE: 383
CALL: phpbb\notification\method\board->notify()

FILE: [ROOT]/phpbb/notification/manager.php
LINE: 295
CALL: phpbb\notification\manager->add_notifications_for_users()

FILE: [ROOT]/phpbb/notification/manager.php
LINE: 266
CALL: phpbb\notification\manager->add_notifications()

FILE: [ROOT]/includes/functions_posting.php
LINE: 2324
CALL: phpbb\notification\manager->add_notifications()

FILE: [ROOT]/posting.php
LINE: 1457
CALL: submit_post()
phpbb_notifications is utf8_bin
PHPBB 3.2.5 running with
PHP 7.2.16-1+0~20190307202206.17+jessie~1.gbpa7be82
and
MySQL(i) 10.2.22-MariaDB-10.2.22+maria~jessie-log

Re: [BETA] [3.2] Prime Notify

Posted: Fri Mar 29, 2019 11:46 pm
by primehalo
I can replicate and confirm. This seems to happen only with 4-byte UTF-8 characters as apparently utf8_bin cannot hold 4-byte characters. To hold these characters in the post_text column of the post table, there is some kind of conversion going on beforehand which chances them to something else, like <r><EMOJI seq="1f914">&#129300;</EMOJI></r>. I'm not exactly sure what code is used to do this conversion so I'll have to look into it more, unless someone already familiar with this can clue me in, which would be awesome....

Re: [BETA] [3.2] Prime Notify

Posted: Fri Mar 29, 2019 11:51 pm
by 3Di
primehalo wrote:
Fri Mar 29, 2019 11:46 pm
unless someone already familiar with this can clue me in, which would be awesome.
Those are Emojis.
viewtopic.php?f=461&t=2422576

To strip those instead

Code: Select all

	/**
	 * Strip emojis from a string
	 * 	 
	 * @param string $string The UTF8 string to be cleared
	 * @return string
	 * @access public	 
	 */
	public function vendor_ext_strip_emojis($string)
	{
		return preg_replace('/[\x{10000}-\x{10FFFF}]/u', "", $string);
	}

Re: [BETA] [3.2] Prime Notify

Posted: Sat Mar 30, 2019 12:44 am
by primehalo
That would remove them completely, or replace them with a specified replacement character, but the board converts them into a format like <r><EMOJI seq="1f914">&#129300;</EMOJI></r> before storing them into the database. Do you know what bit of code does that?

Re: [BETA] [3.2] Prime Notify

Posted: Sat Mar 30, 2019 1:22 am
by 3Di
By the s9e/text-formatter.

The issue here is the DB - The notifications table like many others (ie. logs etc), do not accept 4-bytes unicode chars.
https://area51.phpbb.com/phpBB/viewtopi ... te#p257203

That's why the above proposed method it's used in many extensions.

In the core code used to show to the user the list of chars not allowed:
https://github.com/phpbb/phpbb/blob/e38 ... .php#L1164

Edit:
I happened to discover a bug recently, I created this PR that uses the same pattern to deal with it: https://github.com/phpbb/phpbb/pull/5556

Re: [BETA] [3.2] Prime Notify

Posted: Thu Apr 04, 2019 7:38 am
by primehalo
I posted an updated version, 1.0.0 Beta 11, with a fix. Unfortunately the fix just replaces 4-byte characters with a 3-byte character instead of encoding it into something else that can be stored in the database and then decoding it when extracting from the database, so 4-byte emoji characters won't show up in the email.

Re: [BETA] [3.2] Prime Notify

Posted: Thu Apr 04, 2019 8:08 am
by 3Di
primehalo wrote:
Sat Jan 19, 2019 1:35 am
Your change looks correct to me. For some reason the boolean false value is being changed to the empty string (UNSIGNED DEFAULT '') instead of a zero (UNSIGNED DEFAULT 0). I have no idea why that would be happening.
Because here they have to be all "casted to INT".

Code: Select all

'user_primenotify_enable_post'	=> array('BOOL', true),
'user_primenotify_enable_pm'	=> array('BOOL', true),
'user_primenotify_keep_bbcodes'	=> array('BOOL', true),
'user_primenotify_always_send'	=> array('BOOL', true),
Like 'user_primenotify_*' => array('BOOL', 1),

Or 0 if false.

Re: [BETA] [3.2] Prime Notify

Posted: Mon Sep 16, 2019 11:22 am
by daCaPo
I just have been informed by one of our users that despite his permission/group membership for a certain forum has been revoked, he still receives update notifications. Is it intended behaviour that the extension does not check user permissions before sending out notifications, or did I miss to configure something?