Water tends to run downwards so the heating element will be where the water collects - there is a clue though - the trip happens just as the detergent flap solenoid operates. The fault may well be the heating element but could so easily be the detergent solenoid - it might also be a combination of the two - but I would suspect the detergent solenoid alone as a most probable cause - based on what you say.
If you can disconnect one wire of the solenoid and make it safe and then run a programme you will achieve a diagnosis - or disconnect the heating element and make it safe and run a programme.
To get to the detergent solenoid you will need to take the lower front cover off.
Good luck...
Peccavi
November 2009