Forums | Mahara Community

Developers /
15.04 Watchlist not being added to activity_queue


Al Young's profile picture
Posts: 5

19 August 2017, 0:56

Hi all,

 

Hoping someone can help clarify or push me in the correct direction with how I can troubleshoot or fix this issue.

 

I've trawled through the code to figure out how the watchlist activity fires and pinned it down to the activity_occurred function within lib/activity.php, the only issue is every other form of notification inserts a record into the activity_queue database tables (such as maharamessage, usermessage, viewaccess etc) except for watchlist. No notification seems to be added to the watchlist_queue table either.

 

I've been pouring through our codebase to try track it down but I feel I'm missing something basic. 

 

I've tried ensuring both users are friends, added different pages to watchlists with different user accounts, altering the delay between 1 and 0 and tried manually inserting a record into the database with id of 3 (watchlist) to the database. No joy.

 

I've ensured the cron job is running at least once a minute and ensured both user and view show up correctly within the usr_watchlist_view table.

 

Could anyone provide any assistance?

Al Young's profile picture
Posts: 5

19 August 2017, 2:07

Hi all,

 

Finally managed to figure it out.

 

Cron jobs were set up correctly, that wasn’t the issue. Records from the database relating to watchlist were missing.

 

There are certain functions within the php which are defined but never called anywhere, that was my issue as without calling the function blocks, nothing would run. Some functions are run from the database (in a round about way) as in the name of the function is stored in the database and, using mysql, extracted as a string and run like this. Without the database schema I didn’t even know these functions existed but luckily, i found information on the github pages within lib/upgrade.php. 

github.com/MaharaProject/mahara/blob/15.04.2_RELEASE/htdocs/lib/upgrade.php

 

Summing up changes for the future.

 

Added three records to the event_subscription table: (Adds record to database)

Event

callfunction

blockinstancecommit

watchlist_record_changes.

Saveartefact

watchlist_record_changes.

saveview

watchlist_record_changes.

 

Added one record to the cron table (Gets record from database)

Callfunction

Nextrun

Minute

Hour

Day

Month

Dayofweek

Watchlist_process_notifications

2017-08-18 15:00:00

*

*

*

*

*

 

 

2 results