I have a project that mainly consist of PostGIS tables, but also some shapefiles. All in all I have some 50 layers in use in the project.
The last days, I have had problems with the print composer. Two polygon layers are shown behind point and line layers even if layer ordering is enabled (the same problem in exported maps), they are ordered correctly in QGIS desktop, and shown in the right order in QGIS desktop. Also, at least one line layer does not show in the print composer and is not exported when creating an exported map.
I have tried removing and importing PostGIS layers, same thing happens again. I have also tried removing layer styles and setting them up again without any extra settings.
This is QGIS 2.18. I cannot move to QGIS 3 because of a geomnearest function that does not work with QGIS 3, otherwise that would be my next thing to try.
Are there any ways to check the coherency of the project file? Is there anything else that comes to mind that could cause this kind of trouble?
This has something to do with visibility presets. Even if I have the correct layers saved as a visibility preset, and I tell the composer map to follow that visibility preset, some layers are not shown in the composer (but shown alright in QGIS Desktop when the visibility preset is chosen there). When i deselect the use of visibility preset in the composer, the layers show OK. I have tried to delete presets and re-make them with new names, does not help.