Child pages
  • Check for existence of values in "ListSortings" config option in SetSorting method of kDBEventHandler class
Skip to end of metadata
Go to start of metadata

Imported From: http://groups.google.com/group/in-portal-dev/browse_thread/thread/f3af342eaed10795#

I have a question bout check of values in "ListSortings" config option in SetSorting method of kDBEventHandler class.

In particular it's done with code:

$sorting_prefix = getArrayValue($list_sortings, $event->Special) ? $event->Special : ''; 

I have debugged this with Zend and found that I get $sorting_prefix = '' even in case if I have something like this for SEARCH prefix:

'ListSortings' => array( 
	'' => array( 
		'ForcedSorting' => array("CurrentSort" => 'asc', 'Priority' => 'desc', 'Name' => 'asc'), 
		'Sorting' => array('Name' => 'asc'),
	), 
	'search' => array(),
),

The problem I am having is that these sorting are always applied even if I am trying to ClearOrderFields in SetCustomQuery method since I do NOT want any sorting at all. 

What if we do code below?

$sorting_prefix = in_array($event->Special, $list_sortings) ? $event->Special : '';

Related Tasks

INP-563 - Getting issue details... STATUS

6 Comments

  1. Yes, this makes sense. Please create task about that for 5.0.3
  2. That would be array_key_exists not in_array. Also please check processing of
    other special-based unit config properties, like ItemSQLs, ListSQLs,
    CalculatedFields and so on.

  3. Yes, true - it should be "array_key_exists". I actually put it in
    myself - just haven't posted here yet.

    About checking other special-based unit config properties  ItemSQLs,
    ListSQLs, CalculatedFields. Do you mean you want me to check if they
    have similar issue as described above or that SetSorting applies to
    them and should be checked there too? I actually think SetSorting only
    applies to the lists. Anyway would you please clarify your last note.

    Thanks.

    DA.

  4. Of course they processing can have similar problems and they not related to
    SetSorting in any way :)

  5. Any changes here? Task/patch?

  6. Hi Alex,

    Yes, I have checked and it's the only place. All other already using the
    right way of picking Prefix.

    Task created and patch attached:

    712: PrefixSpecial for ListSortings config option not set in SetSorting
    method of kDBEventHandler class

    INP-563 - Getting issue details... STATUS


    DA.