Notifications in 3.2

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Post Reply
User avatar
david63
Registered User
Posts: 355
Joined: Mon Feb 07, 2005 7:23 am

Notifications in 3.2

Post by david63 »

I know that there have been some changes to the notification system in 3.2 - although I cannot say that I have seen any documentation as to what has changed.

I am struggling with notifications in 3.2 (to be honest I was struggling with notifications in 3.1 - but that's another story!). With any notification created by an extension in 3.2 I keep coming up with the same error messageThe service definition "" does not exist. - this is occurring not only with my extensions but with the Board Rules extension.

This is not a particularly helpful error message and even with the development error reporting there are no clues (well not to me) as to what is causing this error.

Taking the Board Rules as an example - the same code works fine on 3.1, so my question is what has changed to cause this error - or is it a bug?
David
Remember: You only know what you know -
and you do not know what you do not know!

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Notifications in 3.2

Post by DavidIQ »

Are you getting this error while using the 3.2 branch from the Board Rules extension repo?
Image

User avatar
david63
Registered User
Posts: 355
Joined: Mon Feb 07, 2005 7:23 am

Re: Notifications in 3.2

Post by david63 »

DavidIQ wrote: Mon Apr 25, 2016 10:26 am Are you getting this error while using the 3.2 branch from the Board Rules extension repo?
No it's with the released version - I will take a look at the repro one (did not know that there was one)

Edit: When I used the version from the rep[ro (1.0.4-dev) I started getting other errors

Code: Select all

Catchable Fatal Error: Argument 1 passed to phpbb\notification\type\base::__construct() must implement interface phpbb\db\driver\driver_interface, instance of phpbb\user_loader given, called in C:\htdocs\phpbb_dev\ext\phpbb\boardrules\notification\boardrules.php on line 43 and defined
After fixing these (there were four altogether) I then got the The service definition "" does not exist. again
David
Remember: You only know what you know -
and you do not know what you do not know!

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Notifications in 3.2

Post by DavidIQ »

david63 wrote: Mon Apr 25, 2016 10:43 am Edit: When I used the version from the rep[ro (1.0.4-dev) I started getting other errors
:?: There is no such branch in the Board Rules extension repo:
https://github.com/phpbb-extensions/boardrules/branches
Image

User avatar
david63
Registered User
Posts: 355
Joined: Mon Feb 07, 2005 7:23 am

Re: Notifications in 3.2

Post by david63 »

DavidIQ wrote: Mon Apr 25, 2016 1:30 pm There is no such branch in the Board Rules extension repo:
There is - it is the Master branch.

Now that you have pointed me to the 3.2 version I am making headway - I have managed to get a notification to work, albeit not as I want it to but it is now a work in progress :D
David
Remember: You only know what you know -
and you do not know what you do not know!

User avatar
rxu
Registered User
Posts: 164
Joined: Tue Apr 04, 2006 4:28 pm
Contact:

Re: Notifications in 3.2

Post by rxu »

Matt was pointing out some 3.2 upgrade notes (notifications included) here: https://www.phpbb.com/community/viewtop ... &t=2349131
Image

User avatar
david63
Registered User
Posts: 355
Joined: Mon Feb 07, 2005 7:23 am

Re: Notifications in 3.2

Post by david63 »

rxu wrote: Mon Apr 25, 2016 3:29 pm Matt was pointing out some 3.2 upgrade notes (notifications included) here: https://www.phpbb.com/community/viewtop ... &t=2349131
I had seen that but, as I am finding out, there are a lot more changes to notifications than are mentioned in that topic.
David
Remember: You only know what you know -
and you do not know what you do not know!

User avatar
rxu
Registered User
Posts: 164
Joined: Tue Apr 04, 2006 4:28 pm
Contact:

Re: Notifications in 3.2

Post by rxu »

That's true. F.e. notifications_table injection was removed from user notifications.
For 3.2, the parent instruction can be used for notification service definition instead of arguments list, f.e. https://github.com/phpbb-extensions/boa ... ml#L72-L79

The commit with notification changes for 3.2 is here:
https://github.com/phpbb-extensions/boa ... ml#L72-L79
Image

User avatar
david63
Registered User
Posts: 355
Joined: Mon Feb 07, 2005 7:23 am

Re: Notifications in 3.2

Post by david63 »

For the record, and for anybody having the same problem, the original error of The service definition "" does not exist. was caused by this line in the find_users_for_notification() function

Code: Select all

$users[$row['user_id']] = array()
which has been replaced with

Code: Select all

$users[$row['user_id']] = $this->notification_manager->get_default_methods();
David
Remember: You only know what you know -
and you do not know what you do not know!

Post Reply