wpdreams / ajax-search-pro-development

Issues and dev tracking repository for Ajax Search Pro for WordPress plugin
0 stars 0 forks source link

Attachment Image Found in Search but the according Post is not Publish #171

Open tom-honeymoon-production opened 1 week ago

tom-honeymoon-production commented 1 week ago

Describe the bug

the search results show an image (Attachment to a Post with status draft). When I click on the image a 404 error is shown because the post the image is attached to is not PUBLISH

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on 'Europawahl.png.'
  3. Scroll down to '....'
  4. See error 404

Expected behavior

An image attached to a not published Post should not be found by the search

Screenshots

If applicable, add screenshots to help explain your problem.

Environment checklist

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context


ernestmarcinko commented 1 week ago

Hi,

Just letting you know that I aknowledged the issue, just haven't had time to respond yet.

This might be a bit complicated, I'm not sure if it's solveable in general without major performance implications for many installations. To check the attachment parent post post status an additiona table join must be made, which is no bueno, as it's a very "expensive" operation to be avoided.

However I think I will add an option for this with a warning instead, so it's not integrated, but rather optional.