Initial Filter and Warning when displaying as a child-dv

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
JEngels
Posts: 17
Joined: 2014-03-10 14:16
Location: Germany

Initial Filter and Warning when displaying as a child-dv

Post by JEngels » 2014-09-19 11:04

Hi,
what about following problem:
1. Initial filter set in hooks

function publikationen_init(&$options, $memberInfo, &$args){
if(!$_POST['FilterField'][1] && !$_GET['FilterField'][1]){
addFilter(1, 'and', 12, 'isEmpty');
}
return TRUE;
}

Works fine when calling table "publikationen"

2. Records of table "publikationen" are child records.
When request a child from another mother-table-dv following warning appears (but only in popup-modus, calling the childs by a link to the detail records seems to be okay):
"Warning: Missing argument 5 for addFilter(), called in /volume1/web/sites/AS_MediaCollector/hooks/publikationen.php on line 10 and defined in /volume1/web/sites/AS_MediaCollector/incCommon.php on line 412"
But nevertheless child-dv is correct.

What to do?

Thanks in advance
Koepi

udayvatturi
AppGini Super Hero
AppGini Super Hero
Posts: 85
Joined: 2014-06-14 03:08
Location: India
Contact:

Re: Initial Filter and Warning when displaying as a child-dv

Post by udayvatturi » 2014-09-22 13:25

Hi,

Basically filter should have 5 parameters

Eg:

Code: Select all

addFilter(1, 'and', 7, '<=>', 'New');
1. The filter index.
2. How to combine with previous filter. Accepted values: 'and', 'or'.
3. The field index. The first field in a table has an index of 1, the second 2, ... etc.
4 .The filter type (operator). Accepted values (case-sensitive):
'<=>', '!=', '>', '>=', '<', '<=', 'like', 'not like', 'isEmpty', 'isNotEmpty'
5. The filtered value.

It will definitely throw you an error if you use four parameters

I think may be the control is not going to the "If" condition in your code , so you are not getting any error in normal page view..

Code: Select all

function publikationen_init(&$options, $memberInfo, &$args){
if(!$_POST['FilterField'][1] && !$_GET['FilterField'][1]){
addFilter(1, 'and', 12, 'isEmpty');
}	
return TRUE;
}

JEngels
Posts: 17
Joined: 2014-03-10 14:16
Location: Germany

Re: Initial Filter and Warning when displaying as a child-dv

Post by JEngels » 2014-09-22 13:45

Thanks Uday.
But what about the fifth parameter (filtered value) when filter type is 'isEmpty' or 'isNotEmpty' ?
Please excuse me even not knowing the basics...

Koepi

udayvatturi
AppGini Super Hero
AppGini Super Hero
Posts: 85
Joined: 2014-06-14 03:08
Location: India
Contact:

Re: Initial Filter and Warning when displaying as a child-dv

Post by udayvatturi » 2014-09-22 15:18

If you want to search for an Empty String you can try the following
addFilter(1, 'and', 12, =,'');

Post Reply