Announcement center discussion

Press the little “X” on the notification? Maybe we should throw the notification away, when the announcement was read.

looks like I don’t have notifications icons anymore now :smile: and lot of warning in log. I’ll reset the database later tonight and do more test from scratch.

Might be the fact that I moved the container into appinfo/

Alright


I disable and remove your apps, dropped your 2 tables in the database and truncate the oc_notifications. Reinstalled your .zip and I needed to apply your last patch (script.js+main.php). I also needed to move the Container from lib/ to appinfo/.

Everything is almost working now, despite few lines in the logs. Something funny:

If a user is in a group that can create an announcement, he won’t have the notification icon. If I remove that group from the list, the user from that group will see the notification icon, for the announcement made before. I don’t know if it is clear, so:

- User A is in group Admin.
- User B is in group Moderator.
- User A add group Moderator to the AnnouncementCenter list.
- User A create a Announcement.
- User B can read the Annoucement, but won't have the notification icon.
- User A remove group Moderator from the AnnouncementCenter list.
- User B can now see the notification icon.

I think that if User B (while the Moderator group is in the list) create an Announcement, User A do not have the notification icon.

But what if there are multiple notifications which haven’t been read? Would the notification disappear once the first one is read? I would expect as long as unread notification are there, that the icon should remain. Then once all are read, it should disappear.

Right now, you remove notifications one-by-one by clicking the X. But it seems that if you are in a group that can create new announcement, all notification are hidden; until your group is removed from the list, then the notifications are back. Well, ironically, because you have to see the bell icon to remove notifications you will have all the old notifications back when your rights to create new announcement are revoked.

(from what it seems to be)

Notifications are generated by a background job, so make sure that is triggered/run between posting and checking for notifications.

It does not have anything to do with the cron job. I made a new test:

  • Admin create an announcement.
  • Non-Admin (in ‘Moderator’ group) user got the notification icon (refreshing the WebUI multiple times, clearing cache)
  • Admin add the Moderator group to the list of the groups that can create new announcement.
  • User in ‘Moderator’ group refresh the WebUI, no more notification icon.
  • Admin remove the Moderator group from the list of the groups that can create new announcement.
  • User in ‘Moderator’ group refresh the WebUI, the notification icon is back.

Managed to reproduce, created an issue: Notifications don't work for admins · Issue #26 · nextcloud/announcementcenter · GitHub
I hope I can fix that before the final

1 Like

Fixed in Fix notifications for admins by nickvergessen · Pull Request #27 · nextcloud/announcementcenter · GitHub

Thanks for testing @Cult, and @Rello for the new icon

Released 2.0.0 final just now, just in time for the Nextcloud 10 final.

:gift: Download 2.0.0

Full changelog

Changelog since 2.0.0-RC1

1 Like

Hi,

The announcement center 2.0.0 doesn’t work for me.
No group is selected.
I logged in as an admin, and post the announcement, but it stuck at “announcing
”

If I remember well, you need a tick of your crontab, so check if your crontab is running smoothly

The cron job is selected:

Cron

Use system’s cron service to call the cron.php file every 15 minutes.

When was your last cron job execution ?

Please check your browsers network console to see if something went wrong.
Also have a look at your nextcloud.log file

I got these errors today:

Error	PHP	Undefined index: allow_comments at /media/54bf67db-da31-4c50-bb3c-27140944b223/www/nextcloud/apps/announcementcenter/lib/Manager.php#275

Error	index	Exception: {"Exception":"Doctrine\\DBAL\\Exception\\TableNotFoundException","Message":"An exception occurred while executing 'SELECT * FROM `oc_announcements_groups` WHERE `announcement_id` IN (?)' with params [5]:\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_announcements_groups' doesn't exist","Code":0,"Trace":"#0 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php(116): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))\n#1 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(836): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'SELECT * FROM `...', Array)\n#2 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/lib\/private\/DB\/Connection.php(189): Doctrine\\DBAL\\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)\n#3 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php(206): OC\\DB\\Connection->executeQuery('SELECT * FROM `...', Array, Array)\n#4 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/lib\/private\/DB\/QueryBuilder\/QueryBuilder.php(142): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/apps\/announcementcenter\/lib\/Manager.php(307): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/apps\/announcementcenter\/lib\/Manager.php(281): OCA\\AnnouncementCenter\\Manager->getGroups(Array)\n#7 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/apps\/announcementcenter\/lib\/Controller\/PageController.php(112): OCA\\AnnouncementCenter\\Manager->getAnnouncements(5, 0)\n#8 [internal function]: OCA\\AnnouncementCenter\\Controller\\PageController->get(0)\n#9 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(160): call_user_func_array(Array, Array)\n#10 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(90): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\AnnouncementCenter\\Controller\\PageController), 'get')\n#11 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/lib\/private\/AppFramework\/App.php(111): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\AnnouncementCenter\\Controller\\PageController), 'get')\n#12 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php(47): OC\\AppFramework\\App::main('PageController', 'get', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\n#13 [internal function]: OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(Array)\n#14 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/lib\/private\/Route\/Router.php(293): call_user_func(Object(OC\\AppFramework\\Routing\\RouteActionHandler), Array)\n#15 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/lib\/base.php(983): OC\\Route\\Router->match('\/apps\/announcem...')\n#16 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/index.php(48): OC::handleRequest()\n#17 {main}","File":"\/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractMySQLDriver.php","Line":53}

In appinfo/info.xml replace:

with:

<version>1.0.0</version>

Release 2.0.1 for Nextcloud 10 and 3.0.0 for upcoming Nextcloud 11 beta.
See first post or changelog for more information

Hi,

I downloaded the latest Announcement Center 3.0, and try to install it, it gave me an error.
It has a pending update: 1.0.3

Signature could not get checked. Please contact the app developer and check your admin screen.

file_get_contents(/tmp/oc_tmp_IWYI7g-folder//announcementcenter/appinfo/signature.json): failed to open stream: No such file or directory at /media/54bf67db-da31-4c50-bb3c-27140944b223/www/nextcloud/lib/private/IntegrityCheck/Helpers/FileAccessHelper.php#39

Results

=======

  • announcementcenter
    • EXCEPTION
      • OC\IntegrityCheck\Exceptions\InvalidSignatureException
      • Signature data not found.

After several file-integrity scans, it finally installed.
However, when I’m posting the schedule and pressed “Announce”, the announcing is stuck.
Regardless whether I choose Group or not, error persist.

Exception: {"Exception":"Doctrine\\DBAL\\Exception\\TableNotFoundException","Message":"An exception occurred while executing 'SELECT * FROM `oc_announcements_groups` WHERE `announcement_id` IN (?)' with params [5]:\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_announcements_groups' doesn't exist","Code":0,"Trace":"#0 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php(116): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))\n#1 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(836): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'SELECT * FROM `...', Array)\n#2 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/lib\/private\/DB\/Connection.php(189): Doctrine\\DBAL\\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)\n#3 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php(206): OC\\DB\\Connection->executeQuery('SELECT * FROM `...', Array, Array)\n#4 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/lib\/private\/DB\/QueryBuilder\/QueryBuilder.php(142): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/apps\/announcementcenter\/lib\/Manager.php(307): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 \/media\/54bf67db-da31-4c50-bb3c-27140944b223\/www\/nextcloud\/apps\/announcementcenter\/lib\/Manager.php(281): OCA