Re: Bug in container list filtering

Emmanuel Grosjean <[email protected]>
Newsgroups gmane.comp.cms.jahia.devel
Message-ID <[email protected]>
Hello,

The file committed in the CVS is still incorrect since the line which 
would have to move in fact was REMOVED.  The brackets are no more well 
balanced and the database query failed (silently) and simply return no 
result.

I'm working with version 4.1.0_01 and the file in question 
(org/jahia/data/containers/ContainerFilterBean.java) has revision 
1.20.4.3.2.3 wich belongs to tags JAHIA_4_1_0_01, JAHIA_4_1_0_02, 
JAHIA_4_5_M1, ... (the filtering by range is thus innoperant on these 
versions).

The correction indicated below in my first mail is still correct and can 
be easely reported in the actual class (by inserting the new line < 
clauseBuff.append(")"); > between line 642 and 643.

thanks in advance

Regards,

Emmanuel

Stéphane Croisier wrote:

>
> Thanks a lot. Fix committed in the CVS.
>
> Cheers,
> Stéphane
>
> At 17:13 09/05/2005, you wrote:
>
>> Hello,
>>
>> There is a problem in the mechanism of filtering of the container list
>> whenever one employs a clause of the 'range' type.
>> This problem stands in the generation of the SQL request, more precisely
>> in the brackets balancing (an exemple of bad generated request is shown
>> at the end of this mail)
>>
>> This bug occurs in 4.1 branch in the cvs in the class
>> 'org.jahia.data.containers.ContainerFilterBean' in the method 'public
>> String getSelect(int ctnListID)' :
>> the line at line 643 should be moved at line 649 as
>>
>>       if ( !fClause.isRangeClause() )
>>       {
>>          ... skipped code
>>       } else {
>>
>>          String val = fClause.getLowerValue();
>>
>>          clauseBuff.append("(");
>>
>> clauseBuff.append(getMultilangAndStagingFiltering(this.entryLoadRequest)); 
>>
>>          clauseBuff.append(" AND ");
>>          clauseBuff.append(FIELD_VALUE);
>>          clauseBuff.append(fClause.getLowerComp());
>>          clauseBuff.append("'");
>>          clauseBuff.append(JahiaTools.quote(val));
>>          clauseBuff.append("' AND ");
>>          clauseBuff.append(FIELD_VALUE);
>>          clauseBuff.append(fClause.getUpperComp());
>>          clauseBuff.append("'");
>> 643:     clauseBuff.append(")");        <---- this line should be placed
>>                                               just before next bracket
>>                                               below at line 649
>>
>>          val = fClause.getUpperValue();
>>
>>          clauseBuff.append(JahiaTools.quote(val));
>> 648:     clauseBuff.append("')");
>> 649:                                    <--- line move here
>>       }
>>
>>
>> Regards,
>>
>> Emmanuel
>>
>> -------- BAD GENERATED REQUEST ---------
>>
>> SELECT DISTINCT
>>
>>    id_jahia_ctn_entries,
>>
>>    b.id_jahia_fields_data,
>>
>>    b.workflow_state
>>
>> FROM
>>
>>    jahia_ctn_entries a,
>>
>>    jahia_fields_data b,
>>
>>    jahia_fields_def c
>>
>> WHERE
>>
>>    listid_jahia_ctn_entries=34
>>
>>    AND (        a.id_jahia_ctn_entries = b.ctnid_jahia_fields_data
>>
>>        AND     b.fielddefid_jahia_fields_data = c.id_jahia_fields_def
>>
>>        AND     c.name_jahia_fields_def='date'
>>
>>        AND     (((
>>
>>                b.workflow_state>0
>>
>>            AND b.version_id <> -1
>>
>>            AND (b.language_code='fr_FR' OR b.language_code='shared')
>>
>>            AND b.value_jahia_fields_data>='1104534000000'
>>
>>            AND b.value_jahia_fields_data<')1136070000000' <--- HERE !
>>
>>            )))
>>
>>
>>
>> ORDER BY b.id_jahia_fields_data,b.workflow_state
>>
>>
>>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.