Keeping the message id accross message / message_read table

Keeping the message id accross message / message_read table

by Ben Kelada -
Number of replies: 3

Request for comment for issue: https://tracker.moodle.org/browse/MDL-55014

Keeping the message id accross message / message_read table

It contains a code change to keep the original message id when moving to the message_read table

A couple of reasons for the change:

if the tables are ever merged (as planned in MDL-36941 ), then the id's will need to be the same anyway

It is helpful to have them the same id when using ajax to mark  as read / unread and deleting using ajax, i.e. if you mark it as read using the id, then try and delete it it will fail.

Appreciate feedback, thanks

Average of ratings: -
In reply to Ben Kelada

Re: Keeping the message id accross message / message_read table

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Sorry, don't see much advantage here.

Firstly, we need to take into account existing sites. How do we adjust those tables? It would be complicated and not worth it as a temporary solution for merging the two tables together - which is the real issue here. The proposed solution for the upgrade would take a very very long time on large sites, and again, there will be little benefit. Your scenario about ajax implies there is a bug in the (hypothetical?) code that needs addressed - the answer isn't to change to an insert_record_raw.

So, I am not sold on the idea. I think rather than some kind of in-between step before merging the tables (which includes a long upgrade script as well) we should just deal with the merge itself (with the one long upgrade step).

In reply to Ben Kelada

Re: Keeping the message id accross message / message_read table

by Damyon Wiese -
-1 from me. Agree the split of tables is weird - moving them to one table would make nicer code all round - how does this help teachers and students ? it doesn't. How does this help admins - it gives them a nightmare upgrade step. In fact - doing half the job now and half the job later is worse because there are 2 nightmare upgrade steps.

In reply to Damyon Wiese

Re: Keeping the message id accross message / message_read table

by Ben Kelada -

ok no worries, I thought it might be an easy/useful step until if/when the messaging screen gets updated , but it obviously will introduce a long ugprade step so might as well wait.