So I bought a house and the sprinkler system was neglected but appears to be mostly in-tact. One of the PVC pipes going to a zone valve appears to have popped out of the joint where it was glued. It isn't broken or anything like that. If I try to re-glue this will it hold? Or do I need to replace a big section of pipe?
Assuming the pipe end goes far enough into the socket and the plastic parts are of the correct type (PVC, styrene, etc.) you can sand the contacting surfaces to clean off dirt and glue it back into place.
When cleaning anything including baby diapers, it is better to sweep off or scrape off as much solid and semisolid material as you can first. (1) Less cleaning fluid or detergent needs to be used, (2) Less of a mushy mess which in turn means that bleaches or disinfectants will be more effective.