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

Advanced Search, Default Location does not work #13359

Closed
2 tasks done
mihaiolimpiu opened this issue Jul 25, 2023 · 1 comment
Closed
2 tasks done

Advanced Search, Default Location does not work #13359

mihaiolimpiu opened this issue Jul 25, 2023 · 1 comment
Assignees

Comments

@mihaiolimpiu
Copy link

Debug mode

Describe the bug

Advanced Search by "Default Location is wrong, in debug mode it's clear that the queries are wrong.
the query is:

select assets.* from assets where assets.assigned_to is not null and assets.deleted_at is null order by name asc limit 50 offset 0

but it should be more like this (the below is the querry for locations, NOT Default Locations):

select assets.* from assets where (exists (select * from locations where assets.location_id = locations.id and locations.name LIKE '%RO Craiova%' and locations.deleted_at is null)) and assets.assigned_to is not null and assets.deleted_at is null order by name asc limit 50 offset 0

Reproduction steps

  1. Go to advanced search, complete advanced location field
  2. press close button
  3. all database is shown without any filter

Expected behavior

The result should be filtered by Default Location

Screenshots

Snipe IT 1 Screenshot 2023-07-25 145616
Snipe IT 2 Screenshot 2023-07-25 145657

Snipe-IT Version

v6.1.2 build 10938

Operating System

Red Hat

Web Server

Apache

PHP Version

8.1.21

Operating System

Windows 11

Browser

Chrome

Version

115.0.5790.102 (Official Build) (64-bit)

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

This is an upgrade.

@welcome
Copy link

welcome bot commented Jul 25, 2023

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

snipe added a commit that referenced this issue Aug 17, 2023
…ed_search

Fixed #13359 Advanced search by Default Location does not work
@inietov inietov closed this as completed Aug 17, 2023
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

No branches or pull requests

2 participants