Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search results don't display custom labels #1148

Closed
jacobwod opened this issue Aug 24, 2022 · 1 comment
Closed

Search results don't display custom labels #1148

jacobwod opened this issue Aug 24, 2022 · 1 comment
Assignees
Labels
bug plugin:search Functionality and features of the (core) Search plugin
Milestone

Comments

@jacobwod
Copy link
Member

jacobwod commented Aug 24, 2022

Summary

There are two bugs that are related here:

  1. While Admin UI can set both featureTitle and shortFeatureTitle, there is a bug in Client that will display the featureTitle not only in the search results list but also as a map label - where shortFeatureTitle was intended to be used.
  2. Putting the value of featureTitle or shortFeatureTitle inside quotation marks doesn't do what's expected (it should display the value as-is, if string is surrounded by double quotes). (See FeatureInfo: Make it possible for admins to set a hard-coded label when no good attribute values exists on dataset #1126.)

Description

In #1126 I've added the possibility to define hard-coded labels that will be used in search results list and map view, as labels, in case of lacking values in the data source:

This does work as expected:
image

Gives:
image

Now, there's also a possibility to set a label that will be displayed in map:
Skärmavbild 2022-08-24 kl  10 25 08

This does not work as intended however. The MapClickViewer/FeatureInfo/Infoclick part is doing fine:
Skärmavbild 2022-08-24 kl  10 27 07

However, if this layer happens to be active as a search source too, we would expect the value of short display field "Landsbygd B" to show up. It doesn't:

Skärmavbild 2022-08-24 kl  10 29 09

@jacobwod jacobwod added bug plugin:search Functionality and features of the (core) Search plugin labels Aug 24, 2022
@jacobwod jacobwod added this to the 3.x milestone Aug 24, 2022
@jacobwod jacobwod self-assigned this Aug 24, 2022
@jacobwod jacobwod modified the milestones: 3.x, 3.11 Aug 24, 2022
@jacobwod
Copy link
Member Author

I noticed that this introduced a new bug as the labels are visible in the early stage:
Skärmavbild 2022-08-29 kl  11 43 06

We want labels to show only in highlight mode, i.e. restore the functionality introduced in #1002.

jacobwod added a commit that referenced this issue Aug 30, 2022
- shortDisplayFields are shown at the first stage of results (if showResultsInMap is active)
- displayFields are shown in the highlighted stage
- Also, fixed a bug that rendered 'No attributes found' if just one of the attributes returned an undefined value.
- Restores and improves #1002 and closes #1148.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug plugin:search Functionality and features of the (core) Search plugin
Projects
None yet
Development

No branches or pull requests

1 participant