according to [@Joseph's][1] answer, if you want to populate your combobox with **fields** of **vector** layers, since raster layers does not have any fields of attribute you may get the error: `AttributeError: 'QgsRasterLayer' object has no attribute 'fields'`.

so for avoiding that you must equal your **Layers** with **Only** vector layers, like this:<br/>

    layers = [layer for layer in iface.legendInterface().layers() if layer.type() == QgsMapLayer.VectorLayer]

instead of:

    layers = iface.legendInterface().layers() 


good luck...

  [1]: https://gis.stackexchange.com/users/25814/joseph