News:

Support the VirtueMart project and become a member

Main Menu

Bad programming style

Started by GRIG, July 21, 2014, 21:46:57 PM

Previous topic - Next topic

GRIG

file: (joomla root)/modules/mod_virtuemart_cart/mod_virtuemart_card.php
file id line: * @version $Id: mod_virtuemart_cart.php 6555 2012-10-17 15:49:43Z alatak $
line numbers: 60-61

These lines contains following code:

$data->cart_show = '<a style ="float:right;" href="'.JRoute::_("index.php?option=com_virtuemart&view=cart".$taskRoute,$useXHTML,$useSSL).'">'.$linkName.'</a>';
$data->billTotal = $lang->_('COM_VIRTUEMART_CART_TOTAL').' : <strong>'. $data->billTotal .'</strong>';


This action is not a logic or calculation, but HTML-code generation ("view"-part of system). So it is a source of some problems when site developer writes his own module layout. So it must be done not there, but somewhere in (joomla root)/modules/mod_virtuemart_cart/tmpl/default.php. Please, modify files to avoid such problems.


AH

lmao

Just take a trip around the code to find more of these.
Regards
A

Joomla 3.10.11
php 8.0

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

GRIG

Quote from: Hutson on July 21, 2014, 22:53:32 PM
lmao

Just take a trip around the code to find more of these.

I don't need any more examples. I need fixup.

AH

Then support the project and fix it yourself in all the code you find.

Or wait until VM3 is ready
Regards
A

Joomla 3.10.11
php 8.0

whisky

I agree 100% with GRIG !

One of the perfect example of this model/view concerns mixup can been seen when you look on the various payment plug-ins
that store their plug-in 'name' inside their own database table (see attached screen shot on the 'payment_name' column).

There is a LOT of code, where view burdens are carried inside models, controllers...
where in fact this should be done in views.



[attachment cleanup by admin]

Milbo

#6
Whisky

You do not listen. We said it is done in VM3, I wont delay vm3 for days, if we releas in days, Got it?

We do not say, it is good the way it is, no we say IT IS ALREADY CHANGED... so,. why do you not react on this piece of information?

and there is not a LOT code. omg. Define a lot man. 2% is not a lot,... learn to live in a relative world. numbers are nothing as long you do not compare them.

The paymentname is a normal name, if you store html in it, that is your idea, ahhh and you show the order table

Please check the legal requirements, dont tell us how todo it, really. It is a legal requirement in many countries to store the order as it is shown to the customer, .... ecommerce is not just programming. It is maybe not need exactly that way, but a long time ago we decided it todo it that way. I doubt it makes a lot sense to write exceptions for some fields.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

whisky

I thought the vm2.6.x are tagged as Long Term Support ?

I found (or at least understood) in your doc,  that the vm2.6 will be the last one that support Joomla 2.5
so I got the impression that vm3 will be for Joomla 3.

I'm fine to reconsider it when the Joomla 3 will be the standard version for production, for now the safe bet is vm 2.6.

I note, that we will see a much cleaner code base, and I'm awaiting to see it.

Milbo

#8
vm3 runs on joomla 2.5, I wonder why our docs give the impression it works only on j3

Furthermore it makes no sense to bring new features into an old version. Use the svn and see how old the code is. Most people copy the whole module anyway and do their own module. It is not a bug and dont need to be fixed in any way. It is just something you can do nicer, which is done nicer already!
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

AH

Agree with Milbo completely!

There is no point retro fitting anything but security changes to the 2.6 if it means delays to 3.x release.

Regards
A

Joomla 3.10.11
php 8.0