Fix bug #9429: enable validation ids with optional parameter

This patch is related with bug 9429, it enables validation of new selected ids

It is related with ....
https://github.com/qgis/QGIS/pull/1114