Re: New pre subrelease VirtueMart 2.0.1 (with j2.5)

Started by Twix, January 25, 2012, 21:19:36 PM

Previous topic - Next topic

Twix

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!

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Twix

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!

Milbo

It is a j2.5 error, it seems they do not have anylonger getListFooter
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Twix

#4
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!

Milbo

Thanks. I didnt look on it yet. I assume there is a replacment method available. First we wanna check it for j1.7.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jenkinhill

J2.5 still uses getListFooter

eg <?php echo $this->pagination->getListFooter(); ?>
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Twix

Indeed, check for example weblinks component. It goes wrong somewhere else.

Twix

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.

OpenGlobal

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.


Twix

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?

Twix

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.

OpenGlobal

>> administrator\components\com_virtuemart\helpers\vmview.php

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


Bronko

#13
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...

Twix

#14
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