camptocamp / cgxp

22 stars 22 forks source link

CGXP error with GMF 2.2.0rc2 #1119

Open gnerred opened 7 years ago

gnerred commented 7 years ago

I've installed GMF 2.2.0rc2, but CGXP interface returns now an error :

https://preprod.cartoriviera.ch/theme/cadastre

https://preprod.cartoriviera.ch/preprod/wsgi/_debug/view/1498542454

Can someone please help ASAP ?

ochriste commented 7 years ago

it seems to be a bug, afaik ( @sbrunner can confirm )

external_ogc_server is initialized to None in https://github.com/camptocamp/c2cgeoportal/blob/master/c2cgeoportal/views/entry.py#L120

but the None is not checked in https://github.com/camptocamp/c2cgeoportal/blob/master/c2cgeoportal/views/entry.py#L1250 if hasattr(self, "external_ogc_server"):

so the code tries to get a name property from None and fail

I have made a quick hack in your preprod project to see if adding a "not None" check would work and it seems ok. could you test your project and verify that everything is ok for you? (I think especially about loading various layers of various types)

gnerred commented 7 years ago

Thanks @ochriste now it seems to work. What is this hack ? Can it be easily applied on prod, in order to avoid a problem when installing 2.2 on prod ? Or will it be properly fixed in GMF ?

ochriste commented 7 years ago

I modified live the entry.py so no, it cant be deployed I will make a PR to fix the code of c2cgeoportal and let you know when we can do a new dev release

gnerred commented 7 years ago

Ok thanks I wait your feedback.