News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

differences between full version and update version for 2.0.24c

Started by whisky, November 26, 2013, 12:00:21 PM

Previous topic - Next topic

whisky

The automatic update fails at the end with an 'invalid token', so I finished the semi finished update with a folder/folder comparison.

However, there is differences between com_virtuemart.2.0.24c.Updater  version and full com_virtuemart.2.0.24c_extract_first/com_virtuemart.2.0.24c version.

Mainly in category.php, router.php and virtuemart.php

here is the diid/patch for those differences :

--- com_virtuemart.2.0.24c_extract_first/com_virtuemart.2.0.24c/components/com_virtuemart/controllers/category.php   2013-11-22 13:49:42.000000000 +0100
+++ com_virtuemart.2.0.24c.Updater/components/com_virtuemart/controllers/category.php   2013-11-25 16:49:52.000000000 +0100
@@ -56,12 +56,21 @@ class VirtueMartControllerCategory exten
         $view->display();
      } else {
         // Display it all
-         $safeurlparams = array('virtuemart_category_id'=>'INT','virtuemart_manufacturer_id'=>'INT','virtuemart_currency_id'=>'INT','return'=>'BASE64','lang'=>'CMD','orderby'=>'CMD','limitstart'=>'CMD','order'=>'CMD','limit'=>'CMD');
-         parent::display(false, $safeurlparams);

+         $document = JFactory::getDocument();
+         $viewType = $document->getType();
+         $viewName = JRequest::getCmd('view', $this->default_view);
+         $viewLayout = JRequest::getCmd('layout', 'default');
+
+         $view = $this->getView($viewName, $viewType, '', array('base_path' => $this->basePath, 'layout' => $viewLayout));
+
+         $view->assignRef('document', $document);
+
+         $view->display();

      }

      if($categoryId = JRequest::getInt('virtuemart_category_id',0)){
         shopFunctionsF::setLastVisitedCategoryId($categoryId);
      }
+      return $this;
   }
}


--- com_virtuemart.2.0.24c_extract_first/com_virtuemart.2.0.24c/components/com_virtuemart/controllers/virtuemart.php   2013-11-22 13:49:42.000000000 +0100
+++ com_virtuemart.2.0.24c.Updater/components/com_virtuemart/controllers/virtuemart.php   2013-11-25 16:49:52.000000000 +0100
@@ -45,7 +45,7 @@ class VirtueMartControllerVirtuemart ext
    *
    * @return  JController  A JController object to support chaining.
    */

-   public function display(){

+   public function display($cachable = false, $urlparams = false){


--- com_virtuemart.2.0.24c_extract_first/com_virtuemart.2.0.24c/components/com_virtuemart/router.php   2013-11-22 13:49:42.000000000 +0100
+++ com_virtuemart.2.0.24c.Updater/components/com_virtuemart/router.php   2013-11-25 16:49:52.000000000 +0100
@@ -90,9 +90,14 @@ function virtuemartBuildRoute(&$query) {
         if ( isset($jmenu['category']) ) $query['Itemid'] = $jmenu['category'];

-         if ( isset($query['order']) ) {
-            if ($query['order'] =='DESC') $segments[] = $helper->lang('orderDesc') ;
-            unset($query['order']);
+         if ( isset($query['dir']) ) {
+            if ($query['dir'] =='DESC'){
+               $dir = 'Desc';
+            } else {
+               $dir = 'Asc';
+            }
+            $segments[] = $helper->lang('dir'.$dir) ;
+            unset($query['dir']);
         }



         if ( isset($query['orderby']) ) {
@@ -360,8 +365,21 @@ function virtuemartParseRoute($segments)
         return $vars;
      }
   }

-   if (  $helper->compareKey(end($segments),'orderDesc') ){
-      $vars['order'] ='DESC' ;

+
+   //Translation of the ordering direction is not really useful and costs just energy
+   //if (  $helper->compareKey(end($segments),'dirDesc') ){
+   if ( end($segments) == 'dirDesc' ){
+      $vars['dir'] ='DESC' ;
+      array_pop($segments);
+      if (empty($segments)) {
+         $vars['view'] = 'category';
+         $vars['virtuemart_category_id'] = $helper->activeMenu->virtuemart_category_id ;
+         return $vars;
+      }

+   } else

+      //if (  $helper->compareKey(end($segments),'dirAsc') ){
+      if ( end($segments) == 'dirAsc' ){
+      $vars['dir'] ='ASC' ;


what is the proper version ???


Milbo

The updater version is to test if the fix for ordering is finally working. You can use the updater version for any vm version higher than 2.0.0, or so. It is just missing the icons and images, to reduce the size.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/