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

CRM-19048 - Additional fix #9374

Merged
merged 3 commits into from
Dec 7, 2016
Merged

Conversation

jitendrapurohit
Copy link
Contributor

@jitendrapurohit jitendrapurohit commented Nov 11, 2016

This works for following text searches.

  1. @domain.com works and returns result containing @domain.com and not @domain.org.
  2. some@ works fine.
  3. Bounces back to the search page if unsupported operator are used (in boolean mode) at the end of the string. For eg - @, +-, some+, etc as mentioned in the doc file.

@jitendrapurohit jitendrapurohit force-pushed the CRM-19048 branch 2 times, most recently from b196895 to 408fe09 Compare November 11, 2016 13:14
@jitendrapurohit jitendrapurohit changed the title WIP - CRM-19048 - Additional fix CRM-19048 - Additional fix Nov 14, 2016
@jitendrapurohit
Copy link
Contributor Author

test this please

@totten
Copy link
Member

totten commented Nov 16, 2016

Nice updates to the unit tests. :)

$csid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', 'CRM_Contact_Form_Search_Custom_FullText', 'value', 'name');
$url = CRM_Utils_System::url("civicrm/contact/search/custom", "csid={$csid}&reset=1");
$operators = implode("', '", $operators);
CRM_Core_Error::statusBounce("Full-Text Search does not support the use of a search string ending with any of these operators ('{$operators}' or a single '@'). Please adjust your search term and try again.", $url);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the string with any of these operators ('{$operators}' or a single '@')., how would that display? e.g.

  • with any of these operators('Array' or a single '@').
  • with any of these operators('+-~()' or a single '@').
  • with any of these operators('+ - ~ ( )' or a single '@').
  • with any of these operators('+, -, ~, (, )' or a single '@').

Feel like it would be the first one (problematic) -- but any of the others would be fine.

Copy link
Contributor Author

@jitendrapurohit jitendrapurohit Nov 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@totten Here, implode will join the array values with ', ' and '{$operators}' are enclosed within single quotes. So message would be displayed as with any of these operators ('+', '-', '~', '(', ')' or a single '@').

@jitendrapurohit
Copy link
Contributor Author

@totten If the changes seems fine, is this ok to be merged ?

@yashodha
Copy link
Contributor

yashodha commented Dec 7, 2016

merging as per Brian's comments on the issue

@yashodha yashodha merged commit 2fa4cf8 into civicrm:master Dec 7, 2016
@jitendrapurohit jitendrapurohit deleted the CRM-19048 branch December 7, 2016 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants