The engine cut the other day and it felt like fuel starvation as it came and went. No faults recorded or lights showing.

I took the top if the filter housing off and the top 1/3 was air.
I replaced the filter and seals and topped it up with diesel and cranked it over to eventually it started. Next day I checked the filter again and still 1/3 air. I refilled and cranked but this time she ran for 20 seconds and stopped. Could not restart.
I decided to such some of the diesel through the filter with a clear tube attached to the clip after the filter and attached to the lh cylinder head before the pump. Air seems to come through alot. I need to find out if it is the filter leaking or the pipe to the tank. Has anyone else had this sort of problem before? I hope it is not a pump issue.