[3.2][3.3][RC] Thanks for posts (and optional Tapatalk integration)

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
mrgoldy
Development Team Member
Development Team Member
Posts: 1390
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by mrgoldy »

That's probably your timezone equivalent of 1 January 1970 00:00.
All times are saved in a UNIX timestamps, that's counting the amount of seconds from that exact date.
So the timestamp is not filled correctly and it's trying to format 0: $this->user->format_date(0);.
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.

User avatar
Naguissa
Registered User
Posts: 362
Joined: Thu Mar 02, 2017 6:55 am
Location: Barcelona
Name: Naguissa
Contact:

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by Naguissa »

mrgoldy wrote:
Wed Jan 15, 2020 12:57 pm
That's probably your timezone equivalent of 1 January 1970 00:00.
All times are saved in a UNIX timestamps, that's counting the amount of seconds from that exact date.
So the timestamp is not filled correctly and it's trying to format 0: $this->user->format_date(0);.
Just this.

As I mentioned, the notification is called with NULL data, so it can't be correctly displayed.

I think this is a phpBB bug when calling external notifications (aka extensions' notifications), because I've checked method by method against 2 phpBB notification files (internal ones) and there's nothing special. Also, I see 2 calls for each notification, one with data (and nothing to do) and another one without data that is used to draw notifications on the site.

But I have no deffinitive prove in order to open a bug ticket on phpBB, so I continue investigating. Also I didn't see any issue like this on the forum.

User avatar
mrgoldy
Development Team Member
Development Team Member
Posts: 1390
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by mrgoldy »

If you could give me a quick setup on when / where the error occurs, I might be able to have a look for you.
Install this extension, setup XX, do XX to get a notification with no data -- that kinda way. Cheers
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.

User avatar
Naguissa
Registered User
Posts: 362
Joined: Thu Mar 02, 2017 6:55 am
Location: Barcelona
Name: Naguissa
Contact:

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by Naguissa »

mrgoldy wrote:
Wed Jan 15, 2020 2:30 pm
If you could give me a quick setup on when / where the error occurs, I might be able to have a look for you.
Install this extension, setup XX, do XX to get a notification with no data -- that kinda way. Cheers
Thanks for your help offer.

To replicate, you need:

1) phpBB 3.3.0
2) Download master from here: https://github.com/Naguissa/thanks_for_posts -- Master has router.yml corrected to be phpbb 3.3.0 compatible
3) Activate the extension
4) Login as UserA* and give thanks to any message of UserB* (thanks button is present on action bar, same as report, quote, etc)
5) Logout and login as UserB. In notifications, Thanks notifications are completely wrong (no data and date as 0 (1970-1-1 corrected to timezone).

*UserA and UserB are existing users in your board



I've added some var_dumps on gfksx/ThanksForPosts/notification/thanks.php and I can see set_data (inherit from parent) is called twice, the 1st time with data and 2nd time with NULL.

If multiple notification exists, first all are called with data and second all are called with NULL. After 2nd call they are printed, obviously without data.




Thanks for your help.

User avatar
Ticinoforum
Registered User
Posts: 25
Joined: Sat Mar 02, 2019 9:19 pm

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by Ticinoforum »

Naguissa wrote:
Wed Jan 15, 2020 3:23 pm

To replicate, you need:

1) phpBB 3.3.0
2) Download master from here: https://github.com/Naguissa/thanks_for_posts -- Master has router.yml corrected to be phpbb 3.3.0 compatible
3) Activate the extension
4) Login as UserA* and give thanks to any message of UserB* (thanks button is present on action bar, same as report, quote, etc)
5) Logout and login as UserB. In notifications, Thanks notifications are completely wrong (no data and date as 0 (1970-1-1 corrected to timezone).

*UserA and UserB are existing users in your board
Sorry but, in my board (local) update to PHPBB v3.3.0 if I enable the EXT asap I try to read a post board crash and debug message appear...
The one that I put on my previous post.
So, I am not able to make point 4 because I do not have the possibility to press "Thanks"...
BTW: I try to complete remove the EXT and add it (clear of data)

Thanks
Ticino Forum 4.0
ADMINISTRATOR
https://www.ticinoforum.info

User avatar
Naguissa
Registered User
Posts: 362
Joined: Thu Mar 02, 2017 6:55 am
Location: Barcelona
Name: Naguissa
Contact:

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by Naguissa »

Ticinoforum wrote:
Wed Jan 15, 2020 9:52 pm
Sorry but, in my board (local) update to PHPBB v3.3.0 if I enable the EXT asap I try to read a post board crash and debug message appear...
The one that I put on my previous post.
So, I am not able to make point 4 because I do not have the possibility to press "Thanks"...
BTW: I try to complete remove the EXT and add it (clear of data)

Thanks
Ticinoforum wrote:
Tue Jan 07, 2020 6:46 pm
Board at least start, but generate "fatal error" asap I try to read a topic/post.
This is the error:

Fatal error: Uncaught phpbb\notification\exception: NOTIFICATION_TYPE_NOT_EXIST in phpbb\notification\manager.php:915
Stack trace: #0 phpbb\notification\manager.php(951): phpbb\notification\manager->get_notification_type_id('gfksx.thanksfor...')
[...] and similar...

Thanks.

This case an be two things:

1) Chek your local server meets phpbb 3.3.0 requirements (updated from 3.2.x)

2) Maybe there's a db problem, may miss that notification type.

User avatar
jackennils
Registered User
Posts: 229
Joined: Mon Jun 01, 2009 7:48 pm

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by jackennils »

I did not read the whole thing, but maybe he is using a custom style?

User avatar
mrgoldy
Development Team Member
Development Team Member
Posts: 1390
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by mrgoldy »

I had that problem too, because you use lowercase service definitions everywhere (thanksforposts) but you declare them with capitals: ThanksForPosts. Changing the service definitions to lowercase for the notification types solved that issue for me.

Moreover, I did look into it but had a hard time pin pointing the problem. But it's safe to assume this is not really a phpBB bug but rather within the extension. However, I had a hard time locating it as you use a different coding style than I am used to. Perhaps when I get some more time next week I can have another look.
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.

User avatar
Naguissa
Registered User
Posts: 362
Joined: Thu Mar 02, 2017 6:55 am
Location: Barcelona
Name: Naguissa
Contact:

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by Naguissa »

About notification problems, I've been experimenting with class names and so, but I could not solve anything.

Changing bit only breaks the system, and changing everything (db, class names, code and services.yml) presents same issue.

Still cannot see why it doesn't work correctly; if there's any issue there should be an exception or, at least, a warning. But it's getting all files and methods, but they're constructed with no data.

fans
Registered User
Posts: 6
Joined: Sat Jan 20, 2018 8:37 am

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by fans »

Naguissa wrote:
Wed Jan 15, 2020 10:06 pm
2) Maybe there's a db problem, may miss that notification type.
I have the same problem :( . How can I fix notification type?

Hysteriaa
Registered User
Posts: 20
Joined: Mon Jan 20, 2020 8:18 pm

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by Hysteriaa »

Ticinoforum wrote:
Tue Jan 07, 2020 6:46 pm

Board at least start, but generate "fatal error" asap I try to read a topic/post.
This is the error:

Fatal error: Uncaught phpbb\notification\exception: NOTIFICATION_TYPE_NOT_EXIST in phpbb\notification\manager.php:915
Stack trace: #0 phpbb\notification\manager.php(951): phpbb\notification\manager->get_notification_type_id('gfksx.thanksfor...')
[...] and similar...

Thanks.
I have the exact same problem.

fans wrote:
Mon Jan 20, 2020 11:50 am
Naguissa wrote:
Wed Jan 15, 2020 10:06 pm
2) Maybe there's a db problem, may miss that notification type.
I have the same problem :( . How can I fix notification type?
I also want to know how to fix 'notification type'.

User avatar
Naguissa
Registered User
Posts: 362
Joined: Thu Mar 02, 2017 6:55 am
Location: Barcelona
Name: Naguissa
Contact:

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by Naguissa »

To fix that error, you need to check phpbb_notification_types on DB. It has to have these records

notification_type_id --- notification_type_name --- notification_type_enabled
whatever --- gfksx.thanksforposts.notification.type.thanks --- 1
whatever --- gfksx.thanksforposts.notification.type.thanks_remove --- 1

(being whatever a number, depending on your install)


If notification_type_enabled field is 0 you should set it to 1.
If table is missing these records you should add them.


But IDK how it ended that way; I've switched on local and, following correct procedure, there's no problem with data.

Identified problems are:

- Routes deprecated on services.yml, already solved on repository master
- Empty notifications, still no clue why it happens. But at least it doesn't produce a fatal error....



Cheers!

User avatar
Ticinoforum
Registered User
Posts: 25
Joined: Sat Mar 02, 2019 9:19 pm

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by Ticinoforum »

Dear @Naguissa,

I give you more hints:

My board was at version 3.2.8 and I update it to 3.3.0 (using the 3.2.8->3.3.0 automatic update pack), doing in this way, I had all the problems that I write in my post.
Today I make something different, I update just to 3.2.9, and everything works perfect, also notification.
Than I update to 3.3.0 (pack from 3.2.9 to 3.3.0) and now I am in your same situation: all works but notification as no data and point to nothing.
So, since the 3.2.9 all works and 3.3.0 made this "little" bug, maybe making a compare of the two version help to found problem.
All this experiment was made local (using EasyPHP Devserver 17) now on my online version I am at 3.2.9 and everything works fine.

Thanks!
Ticino Forum 4.0
ADMINISTRATOR
https://www.ticinoforum.info

User avatar
Naguissa
Registered User
Posts: 362
Joined: Thu Mar 02, 2017 6:55 am
Location: Barcelona
Name: Naguissa
Contact:

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by Naguissa »

Ticinoforum wrote:
Tue Jan 21, 2020 5:27 pm
Dear @Naguissa,

I give you more hints:

My board was at version 3.2.8 and I update it to 3.3.0 (using the 3.2.8->3.3.0 automatic update pack), doing in this way, I had all the problems that I write in my post.
Today I make something different, I update just to 3.2.9, and everything works perfect, also notification.
Than I update to 3.3.0 (pack from 3.2.9 to 3.3.0) and now I am in your same situation: all works but notification as no data and point to nothing.
So, since the 3.2.9 all works and 3.3.0 made this "little" bug, maybe making a compare of the two version help to found problem.
All this experiment was made local (using EasyPHP Devserver 17) now on my online version I am at 3.2.9 and everything works fine.

Thanks!

In your case, update was performed without disabling extension, right?

A major update has important changes and maybe they affect to this plugin, if not disabled.

Hysteriaa
Registered User
Posts: 20
Joined: Mon Jan 20, 2020 8:18 pm

Re: [3.2][RC] Thanks for posts (and optional Tapatalk integration)

Post by Hysteriaa »

Naguissa wrote:
Tue Jan 21, 2020 11:09 am
To fix that error, you need to check phpbb_notification_types on DB. It has to have these records

notification_type_id --- notification_type_name --- notification_type_enabled
whatever --- gfksx.thanksforposts.notification.type.thanks --- 1
whatever --- gfksx.thanksforposts.notification.type.thanks_remove --- 1

(being whatever a number, depending on your install)


If notification_type_enabled field is 0 you should set it to 1.
If table is missing these records you should add them.


But IDK how it ended that way; I've switched on local and, following correct procedure, there's no problem with data.

Identified problems are:

- Routes deprecated on services.yml, already solved on repository master
- Empty notifications, still no clue why it happens. But at least it doesn't produce a fatal error....



Cheers!
Thanks for your post.

Can you help a bit?

At line 300, my file "--- gfksx.thanksforposts.notification.type.thanks" has the code

Code: Select all

Ssql = 'SELECT * FROM ' . $this->notifications_table . ' WHERE notification_type_id = ' . (int) $this->notification_type_id . ' AND item_id = ' . (int) self::get_item_id($thanks_data);
That same file doesn't contain "notification_type_name" or " notification_type_enabled" (looked up using Ctrl F).

My file "--- gfksx.thanksforposts.notification.type.thanks_remove" doesn't contain any three of them (_id, _name, _enabled)

I have no clue what to add and where.
Can you give me the code (

Code: Select all

like this)
and the line number where I have to put it?
In both of the files? (if it has to be in both of the files)

Thank you in advance!

Post Reply

Return to “Extensions in Development”