VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Twix on January 25, 2012, 21:19:36 PM

Title: Re: New pre subrelease VirtueMart 2.0.1 (with j2.5)
Post by: Twix on January 25, 2012, 21:19:36 PM
Just intalled this version in combination with J!2.5.0 stable.
When I go to payment methods and click on New I get this error:
Fatal error: Call to a member function getListFooter() on a non-object in administrator\components\com_virtuemart\views\paymentmethod\tmpl\default.php on line 122

I had this also with VM 2.0.0 stable. Can you give it a look?
Thanks!
Title: Re: Re: New pre subrelease VirtueMart 2.0.1
Post by: jenkinhill on January 25, 2012, 23:49:18 PM
Like this?  http://forum.virtuemart.net/index.php?topic=96983.0
Title: Re: New pre subrelease VirtueMart 2.0.1
Post by: Twix on January 26, 2012, 11:44:45 AM
I see now I indeed also have it with shipping method. I installed 2.0.1b over 2.0.0, using J!2.5.0 stable. So it seemed this didn't worked.
Do you suggest to delete all files and install it again? My dB is filled with products, I rather don't like to delete that...

Thanks!
Title: Re: Re: New pre subrelease VirtueMart 2.0.1
Post by: Milbo on January 26, 2012, 12:21:40 PM
It is a j2.5 error, it seems they do not have anylonger getListFooter
Title: Re: New pre subrelease VirtueMart 2.0.1
Post by: Twix on January 26, 2012, 12:39:29 PM
Okay. Are you making a fix? Or do I have to wait for J2.5.1? Or...?
VM2 is looking good, it only needs some polishing.
Thanks in advance!
Title: Re: Re: New pre subrelease VirtueMart 2.0.1
Post by: Milbo on January 26, 2012, 14:58:01 PM
Thanks. I didnt look on it yet. I assume there is a replacment method available. First we wanna check it for j1.7.
Title: Re: Re: New pre subrelease VirtueMart 2.0.1
Post by: jenkinhill on January 26, 2012, 16:47:06 PM
J2.5 still uses getListFooter

eg <?php echo $this->pagination->getListFooter(); ?>
Title: Re: New pre subrelease VirtueMart 2.0.1
Post by: Twix on January 26, 2012, 16:49:13 PM
Indeed, check for example weblinks component. It goes wrong somewhere else.
Title: Re: New pre subrelease VirtueMart 2.0.1
Post by: Twix on January 27, 2012, 01:59:52 AM
I've found out where it goes wrong:
administrator\components\com_virtuemart\views\paymentmethod\view.html.php

If you add this it won't give the error:

class VirtuemartViewPaymentMethod extends VmView {

   function display($tpl = null) {

//added
     // Get data from the model
   $items =& $this->get('Data');   
   $pagination =& $this->get('Pagination');

   // push data into the template
   $this->assignRef('items', $items);   
   $this->assignRef('pagination', $pagination);
//

This is just from http://docs.joomla.org/Using_JPagination_in_your_component and I think it needs to be edited. I'm quite new to programming MVC components, but this'll give you an hint where to look.

It's a pitty it only solved the fatal error, since it's still not working as expected. The new button (or edit item) does still not do anything.
Title: Re: New pre subrelease VirtueMart 2.0.1
Post by: OpenGlobal on January 27, 2012, 19:16:34 PM
The problem is nothing to do with pagination and trying to get the footer pagination working is just a sideline. This function shouldn't even be trying to do the footer pagination, the footer pagination is used for the display of the shipping methods, not the adding or editing of shipping methods.

The problem is that when you click on the edit/add buttons, it is going through the default.php layout instead of the edit.php layout.

I can't work out why this is happening, a quick inspection of the view.html.php for the respective views looks fine.

However, this bug renders VM2 completely unusable. We cannot create shipping methods or payment methods.

Title: Re: New pre subrelease VirtueMart 2.0.1
Post by: Twix on January 27, 2012, 20:51:18 PM
Perhaps it's a common file such as vmview.php or vmcontroller.php since this error is also happening at shipping methods and perhaps more. Or maybe some API is changed for Joomla 2.5?
Title: Re: New pre subrelease VirtueMart 2.0.1
Post by: Twix on January 27, 2012, 21:45:42 PM
Okay, again a small step further.

If I have for example the link
administrator/index.php?option=com_virtuemart&view=paymentmethod&task=edit&cid[]=1

And edit it to this, it'll show the correct layout:
administrator/index.php?option=com_virtuemart&view=paymentmethod&layout=edit&cid[]=1

It goes wrong with setting the layout.
Title: Re: New pre subrelease VirtueMart 2.0.1
Post by: OpenGlobal on January 27, 2012, 21:58:40 PM
>> administrator\components\com_virtuemart\helpers\vmview.php

There's no such file on my system (but then I'm still using 2.0.0).

Title: Re: New pre subrelease VirtueMart 2.0.1 (with j2.5)
Post by: Bronko on January 28, 2012, 10:29:05 AM
Hi all,

i`ve got the same Problem. Can I downgrade to 1.7 Joomla oder replace some files from 2.5.0?


I'm using:

Joomla: 2.5.0
Virtuemart: 2.0.0

thx...
Title: [Fix] Paymentmethods editing
Post by: Twix on January 28, 2012, 10:41:11 AM
QuoteThere's no such file on my system (but then I'm still using 2.0.0).
I think it's indeed added in VM 2.0.1b

Please read this developers:

I've looked at the &task=edit for paymentmethods. It goes wrong in the controller.
administrator\components\com_virtuemart\helpers]vmcontroller.php or
administrator\components\com_virtuemart\controllers\paymentmethod.php

Paymentmethod controller is missing the edit function. It uses the function from vmcontroller.php. This doesn't work good, because it's not redirecting. To solve this, I've created an edit function in administrator\components\com_virtuemart\controllers\paymentmethod.php:

   /**
    * Handle the edit task
    * Still in alpha!
    *
     * @author Twentronix
    */
   function edit(){
      $app  = JFactory::getApplication();
      $task = JRequest::getCmd('task');
      $cid  = JRequest::getVar( 'cid', array(0), '', 'array' );
      $id   = (int)$cid[0];
      
      if($task=='edit'){
         $link = 'index.php?option=com_virtuemart&view='.'paymentmethod'.'&layout=edit&cid[]='.$id;
         $app->redirect($link, $msg);
      }
   }

You also have to disable getListFooter at administrator\components\com_virtuemart\views\paymentmethod\tmpl\default.php (line 123)
This is just another bug that needs to be solved.

Replace:
<?php echo $this->pagination->getListFooter(); ?>

With:
<?php //echo $this->pagination->getListFooter(); ?>

Disclaimer:
I'm a newby with MVC programming, my solution could perhaps be implemented on a better way, but shows where to look and how to fix it. Perhaps $id doesn't work if you want to edit the second payment. Also this is only for developing, it won't solve all these issues and only editing of paymentviews is possible with this fix (VM 2.0.1b).

TODO:
- All the needed functions for controller of paymentmethods. There is also none for add new payment.
- Also shipmentmethod and perhaps plenty more...
- getListFooter
Title: Re: New pre subrelease VirtueMart 2.0.1 (with j2.5)
Post by: Twix on January 28, 2012, 12:15:19 PM
Nice!!

I've fixed the paymentmethod edit and add. Replace the code from the previous post with this:

   /**
    * Handle the edit task
    * Still in alpha!
    *
     * @author Twentronix
    */
   function edit(){
      $app  = JFactory::getApplication();
      $task = JRequest::getCmd('task');
      $cid  = JRequest::getVar( 'cid', array(0), '', 'array' );
      $id   = (int)$cid[0];
      
      $link = 'index.php?option=com_virtuemart&view='.'paymentmethod'.'&layout=edit';
      if ($id != null){
         $link = $link.'&cid[]='.$id;
      }
      $app->redirect($link, $msg);
   }

I'm not sure if this is the best way to fix it, but it works :)
Title: Re: Re: New pre subrelease VirtueMart 2.0.1 (with j2.5)
Post by: Milbo on January 28, 2012, 13:34:24 PM
But it works in j1.7.x and in j1.5.

We have first to understand what they do different in j2.5 and then we will change the vmcontroller.
Title: Re: New pre subrelease VirtueMart 2.0.1 (with j2.5)
Post by: capricornio on January 28, 2012, 23:19:44 PM
Milbo,

This error is also happening when I want to add/edit a manufacturer, manuf. category, coupons etc. So it's definitely in the vmcontroller.
Any idea when you have an updated release ? VM is pretty useless when you can't configure your shop and I guess the majority will move from Joomla 1.7 to 2.5 very soon

Thnx
Title: Re: New pre subrelease VirtueMart 2.0.1 (with j2.5)
Post by: Twix on January 28, 2012, 23:27:05 PM
If you have VM 2.0.1b you can try tis temporarily fix. Note that it doesn't fix all:
http://forum.virtuemart.net/index.php?topic=96983.msg319907#msg319907
Title: Re: Re: New pre subrelease VirtueMart 2.0.1 (with j2.5)
Post by: jenkinhill on January 28, 2012, 23:46:13 PM
capricornio, have you been reading this other thread?  http://forum.virtuemart.net/index.php?topic=96983.msg319924#msg319924

I disagree that the majority will move to 2.5 very soon. Most will wait to see if it is fully functional first. After all, most VM2 users have installed it on J1.5 as they feel safer.....
Title: Re: New pre subrelease VirtueMart 2.0.1 (with j2.5)
Post by: maxi1973 on January 29, 2012, 15:22:05 PM
Joomla 1.7 will be no more developed since April 2012 ... a lot of users is running to joomla 2.5.
I suppose it's too early to run, let's start walking, it's too soon to april  :D

I suppose, at least, in march we will have a more stable version of joomla so VM developers may study a stable too version for all users. (sorry for english)

NO PANIC, NO PANIC!!!
Title: Re: Re: New pre subrelease VirtueMart 2.0.1 (with j2.5)
Post by: Milbo on January 29, 2012, 15:51:43 PM
hahahha

We already have stuff implement other need todo now, for example we have name=adminForm AND id=adminForm already. I am quite sure j2.5 is great, simular to vm2.0.0 not completly matured.... even they have a lot j1.5 code and we not vm1.1 code. I think j2.5.3 or so will be really great and stable.
Title: Re: Re: New pre subrelease VirtueMart 2.0.1 (with j2.5)
Post by: jenkinhill on January 29, 2012, 19:27:35 PM
Yeah, it looks like the rushed out J2.5.1 update (in 48 hrs time) still won't have all issues resolved. ( https://groups.google.com/forum/#!topic/joomlabugsquad/4RLnsIvDCVY) I'll probably now wait for 2.5.2 at least......