Check for existence of values in "ListSortings" config option in SetSorting method of kDBEventHandler class

1 view
Skip to first unread message

Dmitry A.

unread,
Apr 1, 2010, 7:26:57 PM4/1/10
to In-Portal Development Team
Hi guys,

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 : '';

Cheers!

DA.

Alexander Obuhovich

unread,
Apr 2, 2010, 2:11:07 AM4/2/10
to in-por...@googlegroups.com
Yes, this makes sense. Please create task about that for 5.0.3

> --
> To unsubscribe, reply using "remove me" as the subject.
>

--
Sent from my mobile device

Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Alexander Obuhovich

unread,
Apr 2, 2010, 5:41:23 PM4/2/10
to in-por...@googlegroups.com
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.
--

Dmitry Andrejev

unread,
Apr 3, 2010, 2:57:02 AM4/3/10
to in-por...@googlegroups.com
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.

Alexander Obuhovich

unread,
Apr 3, 2010, 3:40:21 AM4/3/10
to in-por...@googlegroups.com
Of course they processing can have similar problems and they not related to SetSorting in any way :)

Alexander Obuhovich

unread,
Apr 25, 2010, 2:20:00 PM4/25/10
to in-por...@googlegroups.com
Any changes here? Task/patch?

Dmitry Andrejev

unread,
Apr 25, 2010, 9:01:54 PM4/25/10
to in-por...@googlegroups.com
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


DA.
IncorrectPrefixSelectionForListSortings.patch
Reply all
Reply to author
Forward
0 new messages