XF 2.0 ACP : user search criteria - strange exception

Jean-Baptiste

Well-known member
Hello,

I would like to add a custom search user criteria.

I added the following code in the helper_user_search_criteria template :
Code:
    <xf:formrow rowtype="input"
    label="{{  phrase('referal_date')  }}">

    <div class="inputGroup">
        <xf:dateinput name="criteria[referal_date][start]" value="{$criteria.referal_date.start}" size="15" readonly="{$readOnly}" />
        <span class="inputGroup-text">-</span>
        <xf:dateinput name="criteria[referal_date][end]" value="{$criteria.referal_date.end}" size="15" readonly="{$readOnly}" />
    </div>
       
    </xf:formrow>

And the following user_criteria listener :
Code:
        switch ($rule)
        {
            case 'have_used_mobile_app':
                if ($user['referal_date'] > 1)
                {
                    $returnValue = $user['referal_date'];
                }
                break;
        }

But it's not working, I got the following exception when I hit the search button in my ACP :
Code:
ErrorException: [E_NOTICE] A non well formed numeric value encountered in src/XF/Searcher/AbstractSearcher.php at line 485
[LIST=1]
[*]XF::handlePhpError() in src/XF/Searcher/AbstractSearcher.php at line 485
[*]XF\Searcher\AbstractSearcher->castValueToColumnType() in src/XF/Searcher/AbstractSearcher.php at line 471
[*]XF\Searcher\AbstractSearcher->castValueToColumnType() in src/XF/Searcher/AbstractSearcher.php at line 439
[*]XF\Searcher\AbstractSearcher->applyCriteriaValue() in src/XF/Searcher/AbstractSearcher.php at line 394
[*]XF\Searcher\AbstractSearcher->applyCriteria() in src/XF/Searcher/AbstractSearcher.php at line 361
[*]XF\Searcher\AbstractSearcher->getFinder() in src/XF/Admin/Controller/User.php at line 61
[*]XF\Admin\Controller\User->actionList() in src/XF/Mvc/Dispatcher.php at line 249
[*]XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
[*]XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
[*]XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1891
[*]XF\App->run() in src/XF.php at line 328
[*]XF::runApp() in admin.php at line 13
[/LIST]

Any ideas ?

Best regards
 
Back
Top Bottom