[4.2] Fixes #5216 [OPTION 2]

By **modifying** the behaviour introduced by 6e672d708b1baffee6210e12be2d3e1f5be1a64e, this fixes #5216.
I also have an alternative fix available (#5217). I don't know which way you'd prefer @taylorotwell. Since you have a default callback that deals with "production", I'd say this fix is probably more appropriate than the other one.