Page 2 of 2

Re: Externally Insert Notifications

Posted: Fri Jul 18, 2014 8:51 am
by nickvergessen
tmbackoff wrote:

Code: Select all

namespace dgkim\calcmerit\notification;
This is wrong. Since you are placing this in the actual folder phpBB uses from notifications, your namespace should look like this:

Code: Select all

namespace phpbb\notification\type;
This is wrong, it must be placed in the extensions directory, so the namespace must be dgkim\calcmerit\notification and the file should be in ext/dgkim/calcmerit/notification/some-name.php

Also the type definition should be in your extensions service.yml

You MUST NEVER modify any core files more in 3.1 nor put files anywhere apart from ext/

After adding the notification type to your extensions service.yml be sure to clear the cache.

Re: Externally Insert Notifications

Posted: Fri Jul 18, 2014 5:28 pm
by tbackoff
It was my understanding he was trying to get this to work OUTSIDE of extensions, which is why I had him change it.

Re: Externally Insert Notifications

Posted: Fri Jul 18, 2014 6:12 pm
by John P
Me too.

Re: Externally Insert Notifications

Posted: Fri Jul 18, 2014 6:48 pm
by Geed
tmbackoff wrote:It was my understanding he was trying to get this to work OUTSIDE of extensions, which is why I had him change it.
Right exactly...

EDIT: When I edited the notifications.yml and purged the cache it actually prevented any sort of display. Does this mean I'll have to build some sort of rudimentary extension?

Re: Externally Insert Notifications

Posted: Fri Jul 18, 2014 8:11 pm
by John P
Is it working now?

Re: Externally Insert Notifications

Posted: Fri Jul 18, 2014 9:01 pm
by Geed
John P wrote:Is it working now?
No sir... I wasn't able to change the notifications.yml without the board crashing.

Re: Externally Insert Notifications

Posted: Sat Jul 19, 2014 8:46 am
by nickvergessen
Well it should just use a connector extension for all this stuff then.
Modifying core files is really not good anymore.

Re: Externally Insert Notifications

Posted: Sat Jul 19, 2014 11:07 am
by John P
Geed wrote:
John P wrote:Is it working now?
No sir... I wasn't able to change the notifications.yml without the board crashing.
I tried your files and put the add notification in index.php and it generated a notification.
Maybe you had a typo.
Cleared the cache before testing?

Re: Externally Insert Notifications

Posted: Sat Jul 19, 2014 6:11 pm
by Geed
nickvergessen wrote:Well it should just use a connector extension for all this stuff then.
Modifying core files is really not good anymore.
I see, I'll try to do my best to do that.
John P wrote:
Geed wrote:
John P wrote:Is it working now?
No sir... I wasn't able to change the notifications.yml without the board crashing.
I tried your files and put the add notification in index.php and it generated a notification.
Maybe you had a typo.
Cleared the cache before testing?
So turns out in order for it to work properly, you need to add the new notification type to the bottom of notifications.yml to not break the board. :cry:

EDIT: JK the reason was due to indenting and spacing.

Thank you all for your help!

Re: Externally Insert Notifications

Posted: Tue Aug 26, 2014 1:16 am
by rxu
The question in not directly related to externally stuff, but it's abiut notification system ayway.

Currently it's impossible to add more than one notification per user for the same item_id. For me, this causes problems for "Thanks for posts" ext development because one user can get several "thanks" for the same post_id (which is assigned to the item_id).
I'd appreciate for advice about workaround, I'm out of ideas currently.
Also, is it worth to file a ticket about making this limitation optional? Or even moving it to the notification type base class so extension could use it to determine the set of users to send notifications.