When placing stained glass(any variant greater than 0) glass appears as purple checkered boxes.
the command used was /fill ~-1 ~ ~-1 ~8 ~5 ~5 glass 3 replace air 0 outline
Placing the block with normal methods work as intended(i.e right-clicking with stained glass in hand)
I suppose this is invalid then.
Stained glass is not the same block as glass. Just replace "glass" with "stained_glass". Feel free to consult the wiki if you have any other block name questions: http://minecraft.gamepedia.com/Data_values#Block_IDs