The Joomla! Forum ™






Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed May 09, 2007 6:16 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 10:41 am
Posts: 15729
:'(When you have a sample install and go to the FAQ menu and then select a category to view you get a list of FAQ's. Now try to order that list, for example on the Title. You will notice this is only possible to make Ascending ordering, not Descending. Incorrect/bug?

See screenshot.

System info

Quote:
PHP built On:    Windows NT D1K1JG1J 5.1 build 2600
Database Version: 5.0.24a-community-nt
Database Collation: utf8_general_ci
PHP Version: 5.1.6
Web Server: Apache/2.0.59 (Win32) PHP/5.1.6
WebServer to PHP interface: apache2handler
Joomla! Version: Joomla! 1.5.0 Beta 2 [ Khepri ] 04-May-2007 00:00 GMT
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3


You do not have the required permissions to view the files attached to this post.

_________________
Regards Robin

http://www.linkedin.com/in/robinmuilwijk - http://twitter.com/i_robin


Last edited by Jinx on Sat Aug 25, 2007 6:10 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed May 09, 2007 8:20 pm 
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Oct 05, 2006 12:13 am
Posts: 810
Just to point that the same issue happens for "Author", "Date" and "Hits".

_________________
"The skill of writing is to create a context in which other people can think" - Edwin Schlossberg.


Last edited by leadict on Thu May 24, 2007 8:51 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu May 10, 2007 4:06 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Offline

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4778
Location: Toronto, Canada
This looks like a possible result of the JHTML refactoring.

What is happening:
The category view reads the current sort direction variable from the request and will output the opposite.  This opposite value is passed to JHTML::grid.sort.  Grid.sort takes this value and outputs the opposite.  Two opposites will result in the same output value.

Where to look in the code to fix it:
components/com_content/views/category/view.html.php _buildSortLists():
Code:
      if ($filter_order_Dir == 'DESC') {

         $lists['order_Dir'] = 'ASC';

      } else {

         $lists['order_Dir'] = 'DESC';

      }



libraries/joomla/html/html/grid.php  sort():
Code:
      $direction   = strtolower( $direction );

      $images      = array( 'sort_asc.png', 'sort_desc.png' );

      $index      = intval( $direction == 'desc' );

      $direction   = ($direction == 'desc') ? 'asc' : 'desc';

      ?>

      <a href="javascript:tableOrdering('<?php echo $order; ?>','<?php echo $direction; ?>','<?php echo $task; ?>');" title="<?php echo JText::_( 'Click to sort this column' ); ?>">

      <?php

      echo JText::_( $title );

      if ($order == $selected ) {

         echo JHTML::_('image.administrator',  $images[$index], '/images/', NULL, NULL, '', '', 1 );

      }

      echo '</a>';


We have to do it in one place or the other - can't do both.  There is an API decision involved here so I will let the dev.wg. decide how to fix it - it should be trivial for them.  I would guess they would change the components so that the API doesn't change, but then again, this might be a place to break the beta2 api because it might fall in line with the old api better.  I dunno.

Is this limited to only the one view?  Or is it all views?

Ian


Top
 Profile  
 
PostPosted: Thu May 10, 2007 4:17 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sun Oct 23, 2005 4:01 pm
Posts: 135
Location: Freiburg / Tettnang
Why not fix it like this:

replace:
Code:
if ($filter_order_Dir == 'DESC') {
   $lists['order_Dir'] = 'ASC';
} else {
   $lists['order_Dir'] = 'DESC';
}


with:

Code:
$lists['order_Dir'] = $filter_order_Dir;


the first is not any longer required, the direction is detected in the grid sort method

_________________
schlu.net


Top
 Profile  
 
PostPosted: Thu May 10, 2007 4:36 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Offline

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4778
Location: Toronto, Canada
Hey,

Yeah, that is probably the best option.  The devs will have to fix it anyway, since they are the ones with commit access.

It does involve a design decision - it depends how they want grid.sort to work.  I believe the old API didn't reverse, and now it has been changed.

This is Andrew's baby, so he could probably best decide which way it should be done.

Ian


Top
 Profile  
 
PostPosted: Sat Aug 11, 2007 7:43 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 10:41 am
Posts: 15729
Notified Andrew on this  ;)

_________________
Regards Robin

http://www.linkedin.com/in/robinmuilwijk - http://twitter.com/i_robin


Top
 Profile  
 
PostPosted: Sat Aug 25, 2007 6:08 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6566
Fixed on SVN, thanks !

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
 Profile  
 
PostPosted: Sat Aug 25, 2007 6:41 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 10:41 am
Posts: 15729
Moving to resolved

_________________
Regards Robin

http://www.linkedin.com/in/robinmuilwijk - http://twitter.com/i_robin


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 



Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group