In order to clear our cache when the user relationships cron job runs we need to invoke the user relationships hook and pass information about the expired user relationships.

I've added code to do this and attached a patch.

Comments

sprsquish’s picture

Status: Needs review » Patch (to be ported)
StatusFileSize
new2.17 KB

Hey Annette, thanks for your work on this.

I hadn't really looked at the cron hook in a good long while. I didn't realize how poorly I had written it.

I've updated it to be compatible with all RDBMSes using standard SQL.

The initial search now loads all the rids we need to delete so the second query can use those. I'm also pulling all the data out and putting it in to an array of objects to be better for general use. Now an array of relationship objects keyed by rid. You'll have to modify your catch code accordingly.

Here's the patch

jaydub’s picture

Version: 5.x-2.8 » 6.x-1.x-dev
Status: Patch (to be ported) » Needs review
StatusFileSize
new1.28 KB
new1.53 KB
new1.67 KB

The patch in #1 was never committed as far as I can tell. The updated patches are for both 5.2 and 6.1 branches and address the facts that 1) The code of the cron hook were never actually being called and 2) If they were ever to be called, the queries would have bombed in PostgreSQL due the MySQL-specific method of DELETE on JOINs.

Third patch allows for the user_relationships hook to be called for the delete operation which in 6.1 allows the elaborations plugin to do some cleanup.

jaydub’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.