salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.53k stars 2.1k forks source link

Issue with listview filter using multi-enums #6434

Open JackBuchanan opened 6 years ago

JackBuchanan commented 6 years ago

Issue

If an multi-enum field has a subquery this will cause issues with the SQL query when using the listview filter because of the way multi-enums are saved in the database.

Expected Behavior

Multi-enums give the option to select multiple values at once, if a field has three values selected and the listview filter has only one of these values selected then the record should be returned in the lisview.

Actual Behavior

The record is not returned unless all three options are selected.

Possible Fix

Steps to Reproduce

  1. Add an multi-enum field with a subquery to a modules list view
  2. Have records have multiple values selected within the one multi-enum
  3. Search the module with one value in the multi-enum selected
  4. Check results of search

Context

Unable to search for records with a certain value if that value is stored in an multi-enum with a subquery.

Your Environment

connorshea commented 5 years ago

Isn't this what multienums are supposed to be used for? Can enum types actually have more than one value selected?

Dillon-Brown commented 5 years ago

I had assumed they meant multienums since he was talking about selecting multiple values. If the bug is with the actual "enum" field type then I'm not able to replicate the issue, can you clarify @JackBuchanan?

JackBuchanan commented 5 years ago

Apologies, yes when I made the original post I was meaning multi-enum. I have been able to replicate the issue this morning on Version 7.11.2

samus-aran commented 5 years ago

@JackBuchanan & @Dillon-Brown Can you two meet up with regards to confirming the issue. I'm sure I spoke to you about this Jack and that this doesn't resolve all use cases and potentially we are doing the sub query incorrectly? I'm keen to just close this & the PR appropriately if we don't have a proper solution.

serhiisamko091184 commented 8 months ago

Hello, @JackBuchanan

The issue has been marked as stale because there has been no recent activity. It will be closed if no further activity occurs. Thanks for your contributions.

Regards, Serhii

JackBuchanan commented 8 months ago

Thanks Serhii,

Fix should still be valid but the PR branch will likely need re-based: https://github.com/salesagility/SuiteCRM/pull/6435

Will take a look when I get a free minute.

serhiisamko091184 commented 8 months ago

Thanks for the quick reply @JackBuchanan!

That's great, many thanks!

Regards, Serhii