Externally Insert Notifications

Discussion forum for Extension Writers regarding Extension Development.
User avatar
nickvergessen
Former Team Member
Posts: 4397
Joined: Mon Apr 30, 2007 5:33 pm
Location: Stuttgart, Germany
Name: Joas Schilling
Contact:

Re: Externally Insert Notifications

Post by nickvergessen » Fri Jul 18, 2014 8:51 am

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.
No Support via PM

User avatar
t_backoff
Former Team Member
Posts: 6995
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

Re: Externally Insert Notifications

Post by t_backoff » Fri Jul 18, 2014 5:28 pm

It was my understanding he was trying to get this to work OUTSIDE of extensions, which is why I had him change it.

User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: Externally Insert Notifications

Post by John P » Fri Jul 18, 2014 6:12 pm

Me too.
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

Geed
Registered User
Posts: 197
Joined: Sat Sep 20, 2008 1:02 am
Location: Princeton, NJ
Name: DG Kim
Contact:

Re: Externally Insert Notifications

Post by Geed » Fri Jul 18, 2014 6:48 pm

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?
Last edited by Geed on Fri Jul 18, 2014 8:45 pm, edited 1 time in total.
DG Kim | Princeton '18
Electrical Engineering

User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: Externally Insert Notifications

Post by John P » Fri Jul 18, 2014 8:11 pm

Is it working now?
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

Geed
Registered User
Posts: 197
Joined: Sat Sep 20, 2008 1:02 am
Location: Princeton, NJ
Name: DG Kim
Contact:

Re: Externally Insert Notifications

Post by Geed » Fri Jul 18, 2014 9:01 pm

John P wrote:Is it working now?
No sir... I wasn't able to change the notifications.yml without the board crashing.
DG Kim | Princeton '18
Electrical Engineering

User avatar
nickvergessen
Former Team Member
Posts: 4397
Joined: Mon Apr 30, 2007 5:33 pm
Location: Stuttgart, Germany
Name: Joas Schilling
Contact:

Re: Externally Insert Notifications

Post by nickvergessen » Sat Jul 19, 2014 8:46 am

Well it should just use a connector extension for all this stuff then.
Modifying core files is really not good anymore.
No Support via PM

User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: Externally Insert Notifications

Post by John P » Sat Jul 19, 2014 11:07 am

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?
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

Geed
Registered User
Posts: 197
Joined: Sat Sep 20, 2008 1:02 am
Location: Princeton, NJ
Name: DG Kim
Contact:

Re: Externally Insert Notifications

Post by Geed » Sat Jul 19, 2014 6:11 pm

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!
DG Kim | Princeton '18
Electrical Engineering

rxu
Extensions Development Team
Posts: 2859
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: Externally Insert Notifications

Post by rxu » Tue Aug 26, 2014 1:16 am

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.

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: Baidu [Spider] and 5 guests