text: The colonial war in Morocco provided an almost welcome distraction , but a disastrous defeat there in 1921 led to a coup in which the general Primo de Rivera became dictator .
  
  ###
  
  Primo de Rivera became the dictator of Morocco as a result of a coup in 1921 .