fixed layer being saved before having an id CDB-1852
Merge CDB-1852 into release/2.11.1