Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

API clients sqlSearch logic error #1536

Closed
techkey opened this issue Nov 5, 2015 · 1 comment
Closed

API clients sqlSearch logic error #1536

techkey opened this issue Nov 5, 2015 · 1 comment

Comments

@techkey
Copy link

techkey commented Nov 5, 2015

Please take a look at this code from file portfolio/client/service/ClientReadPlatformServiceImpl.java starting at line 162:

        String extraCriteria = "";
        if (sqlSearch != null) {
            sqlSearch = sqlSearch.replaceAll(" display_name ", " c.display_name ");
            sqlSearch = sqlSearch.replaceAll("display_name ", "c.display_name ");
            extraCriteria = " and (" + sqlSearch + ")";
        }

Example sqlSearch:

status_enum=300 AND display_name LIKE '%k%'

Result extraCriteria:

 and (status_enum=300 AND c.c.display_name LIKE '%k%')

That obviously isn't going to work. I've opted to comment out the 2 replacements (replaceAll) and just prefix the column names myself. But this can be easily fixed with a regex or a test to check if the column name already is prefixed. I'm sure the regular coders here have a appropriate solution for this.

@vorburger
Copy link
Member

@techkey thank you for your interest in Mifos. This Git repository is no longer actively maintained, but we would love to see your contributions over in https://github.com/apache/fineract, which is the exact same code as this one.

Just FYI, that apache/fineract project doesn't use Git Hub Issues but instead they use issues in the FINERACT project in the Apache JIRA, here: https://issues.apache.org/jira. You may also be interested in having a look at http://fineract.apache.org for a better overview and more resources.

I'm closing this old open issue to avoid any future confusion to others.

/Cc FYI @openMF/admins @openMF/core-team @meonkeys @myrle-krantz

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants