See : https://mahara.org/interaction/forum/topic.php?id=7397
Here's the problem (which appears to be intermittent):
1. ArtefactType has a destructor method, which gets called when an artefact object is garbage-collected by PHP.
2. PHP runs destructor methods and garbage collects variables in no guaranteed order when exit() is called.
3. Sometimes the ArtefactType destructor method tries to call DML methods, which use the global variable $db
4. Apparently sometimes the $db global variable has already been garbage collected by the time the destructor runs
5. This causes a fatal "method on a non-object" crash.
It's unclear why this error has only started happening recently. It might be due to a change in the behavior of PHP's garbage collector, or it might be from new Mahara code leaving some artefacts with their $dirty flag set (which triggers that artefact commit).
In either case, both global variables and implicit destructor methods are considered harmful design practices, in part because of this particular thing. So it's high time we got rid of these __destruct() methods.
Alternatively, as a workaround for older Mahara versions, we could add some code to the top of each __destruct() method that re-creates the global $db if it's not set.
Okay, for blog posts in particular, I've found the specific new code that's causing it. I've filed a separate bug 1513716 to take care of that.
With that known issue out of the way, this greater issue becomes Medium priority because it's not known to cause any problems, it just has the major potential to cause problems.