Complex sentence: Before Wahlberg's casting, Ryan Gosling was set to play the role but dropped out of the film in October 2007, one month before filming.
Split into simpler sentences: Before Wahlberg's casting, Ryan Gosling was set to play the role but had to drop out right before principal photography. Gosling reportedly dropped out of the film in October 2007, one month before filming.