All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
  Print view

Help with PATCH to atkmanytoonerelation
Author Message
PostPosted: Mon Mar 22, 2010 8:20 am 
Regular
Offline

Joined: Wed Aug 26, 2009 4:49 am
Posts: 350
Location: Queenstown, New Zealand
Hi

I have a problem which is in atkmanytoonerelation (atk 6.4.3) as follows -

In my customers table a custid field value is "10" (varchar) and the corresponding billname field value is "FORDE SHEARING LTD" (varchar)

The descriptor for the customer table is "[custid] - [billname]"

On the Admin screen the atkmanytoone relation dropdown for fkcustomer works fine and I can select "10 - FORDE SHEARING LTD"

However when I click on SEARCH button I get No results found for the current search query.
I traced this problem to function function
Code:
getConcatFilter($searchValue,$fieldaliasprefix="")


The $searchcondition returned from this function for this data is -

UPPER(REPLACE ( CONCAT_WS('', fkcustomer.custid,fkcustomer.billname), ' ', '') ) LIKE UPPER('%10FORDE SHEARING LTD%')

and of course the UPPER/REPACE/CONCAT_WS sequence evaluated to "10FORDESHEARINGLTD" without spaces !

Therefore NO match

So in the code
Code:
2317          foreach ($concatSeparators as $separator)
2318          {
2319            $value = str_replace($separator, "", $value);
2320          }
2321
2322          $db = $this->getDb();


after line 2320 I inserted
Code:
$value = str_replace(" ", "", $value);

to strip the spaces from the value being search for

All now works !!

Am I making the a good fix ?

If so how do I submit as a patch ?

Thanks

Wayne


Top
 Profile  
 

Re: Help with PATCH to atkmanytoonerelation
PostPosted: Sat Sep 01, 2018 2:22 am 
Regular
User avatar
Offline

Joined: Thu Aug 25, 2011 9:31 pm
Posts: 303
Location: Mumbai, India
Is this taken care in 6.5 / 6.6?


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group