During ww2 radios were used more than in ww1 but from my understanding were in a short supply. How did soldiers fix cables running from forward lines to hq?
That was the job of the signals corps. They were the ones responsible for running cables from the trenches to HQ and the like.
Initially, they ran phone lines right into the British trenches to hopefully allow for fast communications in case of a break-in, etc. These lines were originally put on poles, just like any other phone line, but German artillery kept knocking down the poles and cutting the lines, so the signals corps started burying them.
This caused a major new problem - when a call went through the phone lines, the line would vibrate. These vibrations could be listened to by anybody putting a sensor in the ground within a couple of hundred metres. The British signallers discovered that the Germans were listening in to the phone calls when they started greeting new British units into the front lines by name. So, the telephone lines got removed from the front lines (I believe by about late 1915/early 1916, but don't quote me on that - the unit history is right now in a library at RMC, and I don't have a copy of my own).
Another teething problem they had with laying cables was that when they were laid in the trenches, they were not necessarily done such that they would be kept out of the way. So, there were cases of British soldiers accidentally clotheslining themselves on signal cables. The signallers had to standardize how they laid the cables to prevent accidental injuries.
One of the more humorous things was that the group the signallers REALLY hated were their own side's tanks (far more than the Germans). They kept telling the tankers where not to drive, and the tankers just disregarded it, drove over the cables, broke them, and caused the signallers to have to fix them.
(Guess who read the British signal corps' unit history for a grad school class...)