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

Filter in View with User-ID #868

Closed
ISC-PRO opened this issue Feb 23, 2024 · 3 comments
Closed

Filter in View with User-ID #868

ISC-PRO opened this issue Feb 23, 2024 · 3 comments
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. 1. to develop Accepted and waiting to be taken care of bug Something isn't working

Comments

@ISC-PRO
Copy link

ISC-PRO commented Feb 23, 2024

Steps to reproduce

  1. Create a simple list "MyTable" with only column "ToDo", Type "Text"
  2. Create a simple view "MyToDos" of table "MyTable" and select all columns ("ToDo" and Metadata fields)
  3. Create two Items by different user
  4. Select filter of column "Ersteller" with option "Ich (Benutzer-ID)" -> Result: Success
  5. Edit simple view "MyToDos" and select "Filter" and define column "Ersteller" = "Ich (Benutzer-ID)" -> Result: Unsuccess
  6. In View: no data

See Screenshots.

Expected behavior

My entries

Actual behavior

No data

Tables app version

0.6.6

Browser

Chrome, Version 120.0.6099.225 (Offizieller Build) (32-Bit)

Client operating system

Windows

Operating system

Linux 5.15.0-92-generic x86_64

Web server

None

PHP engine version

PHP 8.1

Database

MySQL

Additional info

Bug_ToDo_01_Overview

Bug_ToDo_02_FilterInList

Bug_ToDo_03_FilterInView

@ISC-PRO ISC-PRO added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Feb 23, 2024
@max-nextcloud
Copy link
Contributor

I also observed this on cloud.nextcloud.com in the supported apps table for 'My apps'

@juliusknorr
Copy link
Member

Copy from #869

We used to search case insensitive before but now we match exactly which is likely more the expected behaviour of a contains filter.

For our use case we should actually rather start implementing #586

As a quick fix we could change the matching to insensitive or maybe rather split for two different filter comparisons

  • contains (case-sensitive)
  • contains (case-insensitive)

Quick hotfix could be this but needs some further checks if this doesn't have any sideeffects:

diff --git a/lib/Db/Row2Mapper.php b/lib/Db/Row2Mapper.php
index f34ef722..2be83e1e 100644
--- a/lib/Db/Row2Mapper.php
+++ b/lib/Db/Row2Mapper.php
@@ -329,7 +329,7 @@ class Row2Mapper {
                                                $qb->expr()->like('value', $qb->createNamedParameter('%,'.$this->db->escapeLikeParameter($value).',%'))
                                        ));
                                }
-                               return $qb2->andWhere($qb->expr()->like('value', $qb->createNamedParameter('%'.$this->db->escapeLikeParameter($value).'%', $paramType)));
+                               return $qb2->andWhere($qb->expr()->ilike('value', $qb->createNamedParameter('%'.$this->db->escapeLikeParameter($value).'%', $paramType)));
                        case 'is-equal':
                                if ($column->getType() === 'selection' && $column->getSubtype() === 'multi') {
                                        $value = str_replace(['"', '\''], '', $value);

@juliusknorr juliusknorr added the 1. to develop Accepted and waiting to be taken care of label Mar 7, 2024
@github-project-automation github-project-automation bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Office team Mar 7, 2024
@ISC-PRO
Copy link
Author

ISC-PRO commented Jan 6, 2025

This problem is solved. We used Tables Version 0.8.1 / 0.8.2, Nextcloud Hub 9 (30.0.2). Thank you.

@ISC-PRO ISC-PRO closed this as completed Jan 6, 2025
@github-project-automation github-project-automation bot moved this from 🧭 Planning evaluation (don't pick) to ☑️ Done in 📝 Office team Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. 1. to develop Accepted and waiting to be taken care of bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants