gltn / stdm

STDM is a free and open source pro-poor land recordation system based on QGIS, PostgreSQL and PostGIS.
http://stdm.gltn.net/
GNU General Public License v2.0
30 stars 30 forks source link

Template selector in the Document Designer does not show existing templates for the current profile #448

Open pgathogo opened 3 years ago

pgathogo commented 3 years ago

In the document designer, the Template Selector dialog does not show existing templates for the current profile. When you open the selector it is empty.

gkahiu commented 3 years ago

Hi Paul,

I cannot reproduce, I can see the template that I saved for the current profile. See below:

image

Perhaps it could also be a 'relatively' old issue addressed in the latest commits, you can try pull the latest master and confirm.

pgathogo commented 3 years ago

@gkahiu new templates are showing, however, for old templates for the same profile are not showing.

gkahiu commented 3 years ago

Yes, now I do confirm. There is now a huge shift in the internal mechanics of how custom attributes (e.g. data source, referenced table name etc.) are stored in a layout hence the reason as to why old (composer-based) templates are not being loaded.

@nyalldawson, the current logic is not able able to read the data source defined in older composer-based templates (see an example here). I see there is a QgsCompositionConverter class for converting 2.x composition to 3.x layouts but its not available in Python bindings. Also am not sure how to do the conversions for STDM composer items (e.g. line, labels, attribute tables etc.) to the new custom layout items. Perhaps we might need something like an STDMTemplateConverter for updating STDM composer-based templates, please assist.