Skip to content

Fix single listing map popup image fallback#2849

Open
Arafat-plugins wants to merge 1 commit intosovware:developmentfrom
Arafat-plugins:fix/single-listing-map-image-fallback-origin-dev
Open

Fix single listing map popup image fallback#2849
Arafat-plugins wants to merge 1 commit intosovware:developmentfrom
Arafat-plugins:fix/single-listing-map-image-fallback-origin-dev

Conversation

@Arafat-plugins
Copy link
Copy Markdown
Contributor

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Security fix
  • Improvement
  • New Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Text changes
  • Other... Please describe:

Description

How to reproduce the issue or how to test the changes

This fixes the single listing map popup image not showing the correct listing image when a listing does not have a preview image.

Previously, Directorist_Single_Listing::map_data() only checked the preview image and then fell back directly to the default image. Because of that, listings that had gallery images but no preview image still showed the fallback grid.jpg image in the single listing map popup.

This change updates the image fallback order in the single listing map data to:

  1. Preview image
  2. First gallery image
  3. Directory default preview image

It also uses Helper::default_preview_image_src() for the default image source and escapes the rendered image output properly.

Steps to reproduce

  1. Create or edit a listing with:
    • no preview image
    • one or more gallery images
  2. Open the single listing page.
  3. In the Location section, open the listing marker popup on the map.
  4. Notice the popup shows the fallback grid.jpg image instead of the uploaded listing image.

Expected result

If no preview image is set, the single listing map popup should use the first gallery image before falling back to the default image.

How to test the fix

  1. Go to a single listing page that has:
    • no preview image
    • at least one gallery image
  2. Open the map popup from the Location section.
  3. Confirm the popup now shows the first gallery image.
  4. Test a listing with a preview image and confirm the preview image is still shown first.
  5. Test a listing with neither preview nor gallery image and confirm the directory default image is shown.

Any linked issues

Support ticket:

Related screenshots:

Screenshot

Checklist

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