Confusing ceiling light fixture wiring
The cable entering from the left is just old wire whose marks have faded or was never polarized in the first place.  I'm not worried about that. Pretend one is white and one is black. 

The box is entirely ungrounded and the old Romex cables do not have a ground wire. Again, not worried about that.  Just leave it dangle.  It's not that I don't like grounds, this is just a pretty low priority as it's unlikely to be touched by humans, and is probably going to be in a GFCI envelope anyway. 

What concerns me is it doesn't look quite right for a switch loop.  It looks like there's only one wire on the orange nut, which us weird. Which makes the red wire nut seem superfluous.  Just rubs me wrong is all. 

Nonetheless, the worst mistake you can make is take apart wire nuts or wires other than the two conductors (and ground if present) that directly lead to the old lamp.  

Are you sure you didn't pull a wire out of the orange nut and put it back on the red nut?  Does the switch still turn the light on and off? does power enter this box even with the switch off? Was there ever a second light location also controlled by this switch?