Skip to content

"Search Attributes" only searches attributes with Item Visibility Flag set #2919

Closed

Description

@objecttothis

Background information

IMPORTANT: If you choose to ignore this issue report template, your issue will be closed as we cannot help without the requested information.

Please make sure you tick (add an x between the square brackets with no spaces) the following check boxes:

  • Reporting an issue of an unmodified OSPOS installation
  • Checked open and closed issues and no similar issue was already reported (please make sure you searched!)
  • Read README, WHATS_NEW, INSTALL.md and UPGRADE
  • Read the FAQ for any known install and/or upgrade gotchas (in specific PHP extensions installed)
  • Read the wiki
  • Executed any database upgrade scripts if an upgrade pre 3.0.0 (e.g. database/2.4_to_3.0.sql)
  • Aware the installation code is in bintray (see README), and GitHub master is for developers only and therefore not complete nor stable

Installation information

OSPOS Installation Info: 3.3.2 - cb67b5
Language Code: en-US

OSPOS Timezone is Different from your Local Timezone.

Local Timezone:
Asia/Baku

OSPOS Timezone:
America/New_York

Extensions & Modules:
» GD: Enabled ✓
» BC Math: Enabled ✓
» INTL: Enabled ✓
» OpenSSL: Enabled ✓
» MBString: Enabled ✓
» Curl: Enabled ✓

User Configuration:
.Browser: Firefox
.Server Software: Server
.PHP Version: 7.4.8
.DB Version: 8.0.21
.Server Port: 443
.OS: FreeBSD 11.3-RELEASE-p11

File Permissions:
» [application/logs:] - 0770 | Writable ✓ | Vulnerable ✗
» [public/uploads:] - 0774 | Writable ✓ | Vulnerable ✗
» [public/uploads/item_pics:] - 0774 | Writable ✓ | Vulnerable ✗
» [import_customers.csv:] - 0640 | Readable ✓ | Security Check Passed ✓

There are problems with file permissions please fix and reload this page.

Security Vulnerability Warning
Permissions higher than 750 for write and 660 for read leaves this software at risk.

» [application/logs:] is writable, but the permissions are higher than 750.
» [public/uploads:] is writable, but the permissions are higher than 750.
» [public/uploads/item_pics:] is writable, but the permissions are higher than 750.
Asia/Baku

Issue

If you go to Items then click the dropdown to the right of the date and select "Search Attributes" your search will only return rows from Item Attributes where the "Items" visibility flag is set in the Attribute definition. The problem with this approach is that just because the user doesn't want the attribute to appear in the items table, doesn't mean they don't want the "Search Attributes" feature to not search those attributes. Here are three examples of where you would want the "Search Attributes" to search all attributes and not just the ones that are visible in the table view:

Let's say you have a "Product Details" attribute. In it you have manufacturer specs about the product that take up a few lines for each item. It would make your table view "messy" to have this column appear, but you want to be able to search it when a customer wants to find products with a certain detail.

You have a sample chapter LONGTEXT attribute type. LONGTEXT attribute types will not be visible by default in the Items table view because of their inherent length, but you want to be able to search them.

You have 25 different attributes and want them to be searchable but you don't want them to all be visible in the items table view because you want to reserve that for only the most essential attributes.

@jekkos I can do the legwork on this, but I want to make sure that this is an OK change to make first.

Activity

  1. added this to the 3.4.0 milestone on Aug 14, 2020
  2. self-assigned this
    on Aug 14, 2020
  3. jekkos commented on Aug 15, 2020

    @jekkos
    Member

    Maybe we should not allow to have those longtext type attributes visible in the table at all?

  4. objecttothis commented on Aug 16, 2020

    @objecttothis
    MemberAuthor

    Maybe we should not allow to have those longtext type attributes visible in the table at all?

    Correct. In the Attribute view form I'm using javascript to disable the attribute visibility multiselect checkbox and default the visibility flag to 0. This means they won't appear. if we find that people want to be able to have a LONGTEXT visible on a receipt, or something of that nature then we will cross that bridge when we come to it. The issue is that if the flag is 0, then "Search Attributes" does not search that particular LONGTEXT.

    I think what this means is that we need to have "Search Attributes" search ALL attributes, not just what is visible in the items table.

  5. jekkos commented on Aug 17, 2020

    @jekkos
    Member

    Ok cool, I guess javascript is the way to go as if you change the attribute type you might need to enable that dropdown again? Or do we need to save the edit first then?

  6. jekkos commented on Aug 17, 2020

    @jekkos
    Member

    I'm not 100% sure on whether we take visbility into account in the search query, but it might be confusing to match records based on data that you're not seeing?

  7. objecttothis commented on Aug 18, 2020

    @objecttothis
    MemberAuthor

    Ok cool, I guess javascript is the way to go as if you change the attribute type you might need to enable that dropdown again? Or do we need to save the edit first then?

    Conversion is allowed from LONGTEXT to TEXT. In that case, the javascript re-enables the visibility of the flag multi-select.

  8. objecttothis commented on Aug 18, 2020

    @objecttothis
    MemberAuthor

    I'm not 100% sure on whether we take visbility into account in the search query, but it might be confusing to match records based on data that you're not seeing?

    How would you suggest allowing the searching of LONGTEXT attributes then? We could change the "Search Attributes" to "Search Visible Attributes" and then add an option to "Search All Attributes". Bottom line is that users need a means to search all attributes. In our case, for example, we don't have space in the items table to make all relevant attributes visible without having to do a lot of horizontal scrolling, but that doesn't mean we don't want to search the attribute. For example "Author" doesn't appear in the table, but we want to be able to search by author and the current "Search Attributes" doesn't allow it because it's not visible in the table.

  9. jekkos commented on Aug 18, 2020

    @jekkos
    Member

    It's fine to implement it as you say. Most of the time I only have one extra column visible, but I just wonder whether it will be usable that way? If you're looking for a specific string and you find multiple matches, would you know which one you need while not showing the attribute column? Just asking so we know what limitations we will face upfront.

  10. objecttothis commented on Aug 18, 2020

    @objecttothis
    MemberAuthor

    I haven't thought this through completely but potentially another way we could approach it is to have a checkbox in the attribute definition to indicate that we want it to be searchable. Then when "Search Attributes" is selected, it would search all attributes with this flag. The downside is that this likely means extending the definition table to include this flag unless we could somehow include it in the definitions flags column. It also means adjusting the business logic to look at the flag and to be able to set the flag.

  11. jekkos commented on Aug 25, 2020

    @jekkos
    Member

    I guess adding the flag might mean adding another table to the join query in items? I don't remember exactly if the definitions table was already in there. If it is then I guess it's just a matter of adding the flag in the where section? But ok it's a bit of work to add all of this and test it.

  12. objecttothis commented on Aug 27, 2020

    @objecttothis
    MemberAuthor

    @jekkos Yeah, I can add the flag in the WHERE clause and then add the flag column in the attribute definitions table to represent the checkbox to make the attributes searchable or not.

    After some more testing, it's clear that this issue is not just limited to Attributes. The search only searches fields that appear in the table. For example, it doesn't search the description column found in the items table because it doesn't appear (and shouldn't appear) in the table. I think perhaps adding an option in the multi-select to search descriptions would resolve that issue. Of course we need to test it to make sure that performance isn't extremely affected.

  13. removed this from the 3.4.0 milestone on Dec 10, 2022
  14. 4 remaining items

  15. jekkos commented on Apr 1, 2026

    @jekkos
    Member

    Fixed by commit 8994fb0 which added the SHOW_IN_SEARCH flag to attribute definitions. This allows attributes to be searchable independently of their visibility in the items table, resolving the issue where 'Search Attributes' only searched attributes with Item Visibility Flag set. Closing as implemented.

  16. added a commit that references this issue on Oct 2, 2026
    1b8ee2e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions