georchestra / mapstore2-georchestra

geOrchestra newest viewer
Other
6 stars 23 forks source link

Cadastrapp printing crash in 2023.02.00 release #699

Closed jusabatier closed 4 months ago

jusabatier commented 4 months ago

Describe the bug Installing https://github.com/georchestra/mapstore2-georchestra/releases/tag/2023.02.00-geOrchestra I can't print plots with cadastrapp.

To Reproduce Steps to reproduce the behavior:

  1. Try to search a plot in cadastrapp, select it and the print it highligthed.
  2. Check the "Print overlays" checbox
  3. In the print overview, the plot isn't highlighted
  4. Try to print generate an error

Expected behavior Print should highlight selected plot without error

@catmorales @landryb @pierrejego

landryb commented 4 months ago

for a reason i don't understand, i don't have the 'Include overlays' checkbox anymore in the print dialog, but i'm on https://github.com/georchestra/mapstore2-georchestra/commit/8f3fe529ee16a045773e14848b37adc8d6ce2e2a and need to test the latest.

But printing works (without overlays)

you say 'try to print generate an error', it'd help if you provide the error message ;)

landryb commented 4 months ago

maybe fallout from #646 ?

landryb commented 4 months ago

i can reproduce, for some reason 'include overlays' is not available in a context with fewer plugins (eg cadastrapp+print only, more or less) but 'include overlays' is here on my default context, and when a plot is selected and one tries to print:

@tdipisa that's a regression... not sure if the regression is in ms2-cadastrapp (which maybe should be built against the same 2023.02.xx version as ms2) or in ms2-georchestra.

landryb commented 4 months ago

the error message is printed by https://github.com/geosolutions-it/MapStore2/blob/2023.02.xx/web/client/plugins/Print.jsx#L618 but since the selected plot is not displayed in the preview, that's probably why e.features[0] is undefined is triggered.

landryb commented 4 months ago

on 2022.01.xx, when i tick/untick the 'include overlays' box, the selected plot is shown/hidden from the preview

MaelREBOUX commented 4 months ago

Hello.

Here in Rennes we pointed exactly the same behaviour. Sounds like a regression. We had many calls from our customers since monday because we upgraded MS last thursday.

Capture d’écran 2024-02-22 à 12 28 49

jusabatier commented 4 months ago

@tdipisa that's a regression... not sure if the regression is in ms2-cadastrapp (which maybe should be built against the same 2023.02.xx version as ms2) or in ms2-georchestra.

I tried to build ms2-cadastrapp against the same MS version as ms2-georchestra uses and it doesn't solve the problem.

landryb commented 4 months ago

i'd try locally reverting the fix for #646

landryb commented 4 months ago

no luck after locally reverting geosolutions-it/MapStore2@15186518 from #646, issue still present, ticking 'include overlays' adds the cadastre layer to the preview but not the selected plot.

edit bah, as always i forget to npm install && npm run compile so i tested the wrong JS. retesting with properly updated JS in a few..

landryb commented 4 months ago

so my initial testing was wrong, but after properly rebuilding and testing the correct JS with a locally reverted geosolutions-it/MapStore2@15186518 i have the selected plot shown in the preview and in the printed pdf. definitely a regression from #646

landryb commented 4 months ago

https://ids.craig.fr/mapstore/#/context/cadastre has the 'print selected plot' feature in the regular print dialog working again.

catmorales commented 4 months ago

It doesn't work with our new deployement based on docker image geosolutionsit/mapstore2-georchestra:2023.02.00-geOrchestra The selected plot is not visible in the print document : image

@tdipisa thank you to check that

tdipisa commented 4 months ago

@catmorales hi @dsuren1 will do a check asap. thank you.

dsuren1 commented 4 months ago

@catmorales @tdipisa In #646, the annotation features are filtered by visibility property in the features added, however in this case the features don't have the property which is causing the filter to exclude these features and eventually the layer is not printed. I will provide a fix factoring in this case. The fix will be provided on MS stable

jusabatier commented 4 months ago

@dsuren1 Maybe you can solve https://github.com/geosolutions-it/MapStore2/issues/9791 at same time by excluding from print the features without geometry ?

tdipisa commented 4 months ago

@catmorales we have just updated the image for stable branch 2023.02.xx . Can you please test also on your side and let us know if it works for you? If yes, we will provide a patch release soon.

catmorales commented 4 months ago

@tdipisa OK thank you I will test it

catmorales commented 4 months ago

I've just tested it and it seems fine. Thank you very much!

image

Will you backport this fix in the 2023.02.00-georchestra image docker ?

tdipisa commented 4 months ago

@catmorales

Will you backport this fix in the 2023.02.00-georchestra image docker ?

No, we will do a patch release 2023.02.01-geOrchestra

tdipisa commented 4 months ago

@catmorales

Will you backport this fix in the 2023.02.00-georchestra image docker ?

No, we will do a patch release 2023.02.01-geOrchestra

@catmorales done with https://github.com/georchestra/mapstore2-georchestra/releases/tag/2023.02.01-geOrchestra

catmorales commented 4 months ago

Thank you !

MaelREBOUX commented 4 months ago

Good job ! Thanks for the fix.