Page 42 of 48

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

Posted: Tue Jan 21, 2020 9:22 pm
by Ticinoforum
Naguissa wrote:
Tue Jan 21, 2020 6:24 pm
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.
Yes, I confirm...first time did not "disable" my extension!
But in second test, 3.2.8->3.2.9->3.3.0 I made "as per manual"!
So, I think that if you have spare time to checks difference between core files on 3.2.9 amd 3.3.0, maybe you understand better the "notify data" problem.
This because, I confirm again, with 3.2.9 all works fine with current master version of your ext.

Thanks.

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

Posted: Tue Jan 21, 2020 9:43 pm
by Naguissa
Ticinoforum wrote:
Tue Jan 21, 2020 9:22 pm
Naguissa wrote:
Tue Jan 21, 2020 6:24 pm
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.
Yes, I confirm...first time did not "disable" my extension!
But in second test, 3.2.8->3.2.9->3.3.0 I made "as per manual"!
So, I think that if you have spare time to checks difference between core files on 3.2.9 amd 3.3.0, maybe you understand better the "notify data" problem.
This because, I confirm again, with 3.2.9 all works fine with current master version of your ext.

Thanks.

No, I updated old local copy (probably 3.2.8, but maybe earlier) to 3.3.0 disabling all extensions and I had no problems.

It was performed in a linux system, so it's worse tolerating capitals, and even so it was performed flawlessly (leaving aside services.yml and empty notifications).

I have to test it on a Windows 10 (cheap chinese) tablet and a portable server, but I expect far less problems on that machine, as it doesn't distinct between leter cases.


I suspect about db migrations between 3.2.x and 3.3.x when extensions are not disabled. But that doesn't fit to phpbb migration rules...


But still, it doesn't solve the "empty notifications problem".

I have a fix idea: as notifications are called twice, one with data and other without, I can create a static object to store data and try use it on 2nd call. But I need some spare time, I will take it from wherever I can....

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

Posted: Wed Jan 22, 2020 8:26 am
by fans
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)
I did this, and it was fine for a couple of days. Thank you for that!
But today I got a warning on the top of the screen:
[phpBB Debug] PHP Warning: in file [ROOT]/ext/gfksx/ThanksForPosts/notification/thanks.php on line 109: sizeof(): Parameter must be an array or an object that implements Countable

What is wrong again?

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

Posted: Wed Jan 22, 2020 9:00 am
by murrrphy
fans wrote:
Wed Jan 22, 2020 8:26 am
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)
I did this, and it was fine for a couple of days. Thank you for that!
But today I got a warning on the top of the screen:
[phpBB Debug] PHP Warning: in file [ROOT]/ext/gfksx/ThanksForPosts/notification/thanks.php on line 109: sizeof(): Parameter must be an array or an object that implements Countable

What is wrong again?
Just replace or edit this line, like this:

Code: Select all

return (is_array($thankers)) && (sizeof($thankers) == 1) && $this->user_loader ? $this->user_loader->get_avatar($thankers[0]['user_id']) : '';
You have to ensure, that $thankers is an array.

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

Posted: Wed Jan 22, 2020 9:50 am
by Hysteriaa
Hysteriaa wrote:
Tue Jan 21, 2020 7:59 pm
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!
Is there already a solution for this anyway?

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

Posted: Wed Jan 22, 2020 10:16 am
by Naguissa
Hysteriaa wrote:
Wed Jan 22, 2020 9:50 am
Is there already a solution for this anyway?

That fields need to be on database, phpbb_notification_types table, not any file.

About usage, classes inherit from <PHPBB_ROOT>/phpbb/notification/type/base.php , but can be used in any file of phpbb....

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

Posted: Wed Jan 22, 2020 10:20 am
by Naguissa
murrrphy wrote:
Wed Jan 22, 2020 9:00 am
Just replace or edit this line, like this:

Code: Select all

return (is_array($thankers)) && (sizeof($thankers) == 1) && $this->user_loader ? $this->user_loader->get_avatar($thankers[0]['user_id']) : '';
You have to ensure, that $thankers is an array.
I've done that in local changes, but problem is that the class is created with no data, so it's NULL, and then count trows that warning.

It's a good practice ensure everything, but main problem happens before.

P.S.: Thanks for helping!

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

Posted: Wed Jan 22, 2020 10:26 am
by murrrphy
Naguissa wrote:
Wed Jan 22, 2020 10:20 am
murrrphy wrote:
Wed Jan 22, 2020 9:00 am
Just replace or edit this line, like this:

Code: Select all

return (is_array($thankers)) && (sizeof($thankers) == 1) && $this->user_loader ? $this->user_loader->get_avatar($thankers[0]['user_id']) : '';
You have to ensure, that $thankers is an array.
I've done that in local changes, but problem is that the class is created with no data, so it's NULL, and then count trows that warning.

It's a good practice ensure everything, but main problem happens before.
My fix was a response to the PHP warning that user fans got, not for the problem of empty notifications. ;-)

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

Posted: Wed Jan 22, 2020 11:04 am
by Hysteriaa
Naguissa wrote:
Wed Jan 22, 2020 10:16 am
Hysteriaa wrote:
Wed Jan 22, 2020 9:50 am
Is there already a solution for this anyway?

That fields need to be on database, phpbb_notification_types table, not any file.

About usage, classes inherit from <PHPBB_ROOT>/phpbb/notification/type/base.php , but can be used in any file of phpbb....
Yeah that's what I meant, sorry. My English isn't very good but I meant also in the database.

I only don't know what fields/codes (I don't know the right word because of my English) has to be added and where exactly.
Yes, in the database.. But I'm sure there is a exact place in the table, so that's what I meant with 'where exactly'.

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

Posted: Wed Jan 22, 2020 11:15 am
by Naguissa
Hysteriaa wrote:
Wed Jan 22, 2020 11:04 am
Yeah that's what I meant, sorry. My English isn't very good but I meant also in the database.

I only don't know what fields/codes (I don't know the right word because of my English) has to be added and where exactly.
Yes, in the database.. But I'm sure there is a exact place in the table, so that's what I meant with 'where exactly'.
Database, table phpbb_notification_types

FIELDS:
notification_type_id --- notification_type_name --- notification_type_enabled


DATA (2 rows):
whatever --- gfksx.thanksforposts.notification.type.thanks --- 1
whatever --- gfksx.thanksforposts.notification.type.thanks_remove --- 1


If records are missing you have to set notification_type_id as one number not used yet.

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

Posted: Wed Jan 22, 2020 12:44 pm
by Hysteriaa
Thank you so much!

It works perfect, no bugs or anything!

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

Posted: Wed Jan 22, 2020 7:52 pm
by mrx1983
i also tried to find the culprit, but i'm also a bit lost at the moment. it looks like it can access the nofification data within the function "users_to_query()" and after that in all the functions like "get_avatar()", "get_title()" etc. the notification data is not there. its gone. really strange, i wonder what could have changed between phpbb 3.2 and phpbb 3.3 that causes this.

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

Posted: Thu Jan 23, 2020 2:07 pm
by fans
Oh guys! There are so many problems with this extention. First I added rows to DB. After that I have changed /ext/gfksx/ThanksForPosts/notification/thanks.php. But anyway I still have the problem. I made a test “thanks” and now I got notification dated 01 jan 1970, which can’t be marked as read…

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

Posted: Thu Jan 23, 2020 2:19 pm
by Naguissa
fans wrote:
Thu Jan 23, 2020 2:07 pm
Oh guys! There are so many problems with this extention. First I added rows to DB. After that I have changed /ext/gfksx/ThanksForPosts/notification/thanks.php. But anyway I still have the problem. I made a test “thanks” and now I got notification dated 01 jan 1970, which can’t be marked as read…
Yes, that's the problem I'm investigating....

And that's why this extension is marked as [3.2] compatible and not [3.2][3.3]....

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

Posted: Fri Jan 24, 2020 6:17 am
by potku
Man, it's a tough job being an EXT developer... Kudos to you, Naguissa. :)

This EXT is very important to us, so we will wait for as long as it takes for this to be compatible with phpBB 3.3 before we upgrade our phpBB. Thanks for all your hard work. :)