While testing the plugin in various scenarios, I've noticed that there
are two situations which the current code does not handle quite well:
* Detecting for existing txn_id record was likely to throw "found more
than one record" debugging message. Fixed by explicitly ignoring
multiple records.
* The incoming IPN verification message does not always contain the
recipient's email in the "business" field. When a payment has to be
claimed manually at PayPal (e.g. as a result of currencies mismatch
and other settings), the email is coming only in the "receiver_email"
field. This led to PHP notice and caused the script to fail falsely.
This was done earlier than the usual deprecation
process since we have changed the table structure.
It would take time to change the logic in these
functions, but as they have been deprecated for
some time it was decided to forego this effort.
Also deprecated the following functions -
1. message_move_userfrom_unread2read - It is not necessary
for us to mark a message as read on user deletion.
2. message_get_blocked_users - Horrible logic used to
determine if a user is blocked via reference on some
randomly chosen 'isblocked' variable.
3. message_get_contacts - The same as above. This can be
done in a much nicer way.
4. message_mark_message_read - We want two functions to do
this to avoid confusing messages and notifications.
5. message_can_delete_message - This assumed the variable
$message contained the 'useridto' property, which
was present in the old table structure. We do not want
future usages where a query is done on the new table
and is simply passed as this won't contain this property.
6. message_delete_message - Same as above.
Use question_get_top_category() instead of directly inserting into DB when
parent category is 0. This is to make sure we are not ending up with having
multiple top level question categories for a single context.
We are changing how the API behaves so the old tables will never
be populated. This unit test is testing a deprecated function
which we will not be refactoring to use the new table structure.
* Since City/town and Country have been added in $CFG->showuseridentity
since 3.4, we need to exclude the required city and country columns
when fetching the extra columns using get_extra_user_fields().