Skip to content

Fix empty place suggestion titles for plain addresses (Nominatim provider)#65

Open
iamnothardcoded wants to merge 1 commit into
tastyigniter:4.xfrom
iamnothardcoded:fix/nominatim-autocomplete-empty-title
Open

Fix empty place suggestion titles for plain addresses (Nominatim provider)#65
iamnothardcoded wants to merge 1 commit into
tastyigniter:4.xfrom
iamnothardcoded:fix/nominatim-autocomplete-empty-title

Conversation

@iamnothardcoded

Copy link
Copy Markdown

The bug

NominatimProvider::placesAutocomplete() maps the suggestion title from Nominatim's name field:

->title((string)$item->name)

Nominatim only populates name for named POIs (restaurants, landmarks). For plain street addresses — which is what delivery customers type — name is an empty string, so the suggestion title is blank.

User-facing impact

In ti-theme-orange, SearchesNearby::onSelectSuggestion() writes the selected suggestion's title back into searchQuery. With a blank title the query becomes empty, and FulfillmentModal::onConfirm() then silently skips the address branch (if ($this->searchQuery && $this->showAddressPicker)) — no validation error, no stored user position. The customer believes they set their delivery address; checkout shows "No delivery address provided".

This affects every install using the default/free Nominatim geocoder (no Google API key).

Repro: guest visitor → fulfillment modal → delivery → type a street address with house number (e.g. Bochumer Str. 76, Castrop-Rauxel) → select the suggestion → input blanks → Confirm → checkout has no delivery address.

The fix

Fall back to display_name when name is empty. display_name is guaranteed non-empty and — being Nominatim's own output — re-geocodes cleanly when onConfirm() geocodes the title verbatim. Named POIs keep their name as before (existing test still passes).

Test added; full NominatimProviderTest + GoogleProviderTest suite passes (27 assertions).

Nominatim's 'name' field is only populated for named POIs; plain street
addresses (e.g. house-number results) return an empty name. The suggestion
title therefore rendered blank, and themes that write the selected
suggestion's title back into their search query (e.g. ti-theme-orange's
SearchesNearby::onSelectSuggestion) end up with an empty query — the
fulfillment confirm then silently skips storing the delivery position and
checkout reports no delivery address.

Fall back to display_name, which is guaranteed non-empty and re-geocodable.
iamnothardcoded added a commit to iamnothardcoded/tastyrhodos that referenced this pull request Jul 15, 2026
…e#65

Removal instructions in the class docblock + CLAUDE.md TODO.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant