Put the onion in a large frying pan, sit the fish on top and pour the wine or stock over. Bring to a gentle simmer, cover and cook the fish for 6–8 minutes or until cooked through. Remove and cool. Strain out the onion (keep the wine or stock if you are making the sauce, right) and mix into the mashed potato with the herbs.
Flake in the fish in decent-sized chunks and season. Gently mix everything and, using floured hands, shape into 8 cakes. Lightly dust with flour, dip in egg and then in breadcrumbs. Chill for at least 30 minutes (important or they will come apart in the pan).
Heat 1cm oil in a large frying pan. Fry the fish cakes in batches for 3–4 minutes each side or until they are golden, crisp and heated through. Drain on kitchen paper.