Skip to content

[17.0][FIX] base_geoengine: Fix Vector Layer related Error - #481

Draft
anusriNPS wants to merge 1 commit into
OCA:17.0from
PyTech-SRL:17.0-fix-geoview
Draft

anusriNPS wants to merge 1 commit into
OCA:17.0from
PyTech-SRL:17.0-fix-geoview

Conversation

@anusriNPS

Copy link
Copy Markdown
Contributor

FW #417

    Notifying user to define selected attribute_field_id of
supported type from vector layer as part of geoengine view
xml defintion which avoids observed JS error.
@max3903 max3903 changed the title [17.0][FW] base_geoengine: Fix Vector Layer related Error [17.0][FIX] base_geoengine: Fix Vector Layer related Error Sep 16, 2026
@max3903 max3903 added this to the 17.0 milestone Sep 16, 2026

@max3903 max3903 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review

Verdict: approve with nits — sensible forward-port of merged #417; please fix the it.po header regression before merge.

What it does

When a vector layer’s attribute_field_id isn’t available on the loaded records (typically missing from the geoengine view fields), styling/legend used to blow up in JS. This adds checkAttributeFieldUsage(), shows a warning notification, and skips style/legend setup.

Good

  • Matches the already-merged 16.0 fix (#417); same approach.
  • Early-outs around styleVectorLayer / initLegend / setStyle avoid cascading errors.
  • User-facing _t + notification is better than a console exception.
  • CI is green.

Should fix

  1. it.po header wipe — this diff drops Language: it, Weblate Plural-Forms, Last-Translator, and X-Generator. Please only add the new msgid and restore the previous header metadata.
  2. Null-safe attribute_field_idextractLayerValues still does cfg.attribute_field_id[1] with no guard. Prefer an early return in checkAttributeFieldUsage:
if (!cfg.attribute_field_id) {
    return true;
}

(Same concern was already raised on #417.)

Nits

  • Warning can fire on every domain/layer refresh → possible notification spam.
  • PR body is only FW #417 — a short “why” would help reviewers.
  • Please add the needs review label.

Process

Age 0 days / 0 approvals so far — not merge-ready yet under OCA policy (5 days + 2 reviews). Related consumer: OCA/field-service#1621.

@anusriNPS
anusriNPS marked this pull request as draft September 17, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants