Author Topic: Bug in Virtuemart 1.1.9 with category module  (Read 119839 times)

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Bug in Virtuemart 1.1.9 with category module
« on: June 20, 2011, 17:20:53 pm »
The new update VM 1.1.9 seems to have a bug in the shop.browse.php. If the main category has no product but subcategories, where the products reside, VM tells that the category is empty. I did exchange the VM 1.1.9 shop.browse.php with the older VM 1.1.8 shop.browse.php and it works again as expected.

Tanatus

  • Beginner
  • *
  • Posts: 2
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #1 on: June 20, 2011, 21:20:08 pm »
Has anybody found the solution?
I have the same problem  :(

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28536
  • Always on vacation
    • Jenkin Hill Internet
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #2 on: June 20, 2011, 23:46:38 pm »
There are just 2 lines different between administrator/components/com_virtuemart/html/shop.browse.php in V1.1.8 and 1.1.9

Around line 36 in 1.1.8
Code: [Select]
$search_limiter= $vmInputFilter->safeSQL( vmGet( $_REQUEST, 'search_limiter', null ));
becomes
Code: [Select]
$search_op= $vmInputFilter->safeSQL( vmGet( $_REQUEST, 'search_op', null ));
$search_limiter= $vmInputFilter->safeSQL( vmGet( $_REQUEST, 'search_limiter', null ));

and around line 85 in 1.1.8
Code: [Select]
elseif( $num_rows == 0 && empty($product_type_id) && !empty($child_list)) {becomes
Code: [Select]
elseif( $num_rows == 0 && empty($product_type_id) && empty($child_list)) {(notice the missing ! in 1.1.9

Try adding in the ! and see if it fixes the issue.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart 4.0.14 10805  J 3.10.11 PHP 8.0.27

CaféTango

  • Beginner
  • *
  • Posts: 12
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #3 on: June 21, 2011, 05:42:05 am »
The fix did the trick.  Thanks.

Cheers,
Cha

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #4 on: June 21, 2011, 10:32:02 am »
That fixes it. But it is also possible to use the shop.browse.php from VM 1.1.8. Despite of that it seems that every update produces more errors.  The '!' is a logical php operator and not an orthographic error. Deleting operators for whatever purpose does not mean a plus of functions. As far as I can see, it was only done to show the sentence that 'category is empty'. from the language file. I think it is more important to show subcategories and products. VM has by default the possibility to unpublish empty categories.

zanardi

  • Contributing Developer
  • Full Member
  • *
  • Posts: 878
    • GiBiLogic
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #5 on: June 21, 2011, 11:39:57 am »
I am perfectly aware that ! is not an ortographic error, suggesting that the lead developer of VirtueMart 1.1.x does not know about this is very funny :-)
Anywyay, look at this: http://forum.virtuemart.net/index.php?topic=81461.msg268327#msg268327. That is why i made this correction; other users seem to think that THIS is the correct way for it to behave.

Please note that I ASKED LOUDLY for testing of VM 1.1.9 BETA before releasing it, on this forum also, but very few responded. Maybe we could have considered more about introducing this change. Now i will think about it.

@franzpeter: saying that every update produces more errors is simply not true. Not only because this is not really a bug, but even if it was we introduced a bug while fixing other ten or more, and in a complex system like VirtueMart that is not so bad, believe me. I always like to remind that there is no "WE" and "YOU". VM is a community effort, open for everyone to contribute, fix, and bring forward. If it fails, it means that we ALL fail, not just the people who actually commit the code, but every single VM user in the world, ESPECIALLY the ones who make business with it and give back nothing.

Have a nice day everyone!
--
Francesco (zanardi)
http://extensions.gibilogic.com
@gibilogic on Twitter

yabadabadoo

  • Beginner
  • *
  • Posts: 1
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #6 on: June 21, 2011, 18:24:21 pm »
Had a mad fright after i updated ...(without backing up ... please dont tell anyone :)

Just wanted to thank you for posting the solution!!!

 8) :o ;D :P

bettondesign

  • Guest
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #7 on: June 22, 2011, 15:24:29 pm »
Just had a big scare when updating Virtuemart but thanks to your '!' solution I have fixed it. Thank you :)

lipes

  • Full Member
  • ***
  • Posts: 720
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #8 on: June 22, 2011, 22:44:48 pm »
i've got the same problem here when i've update 1.1.8 to 1.1.9 ..

I only change the new:
elseif( $num_rows == 0 && empty($product_type_id) && empty($child_list)) {

to the old line:
elseif( $num_rows == 0 && empty($product_type_id) && !empty($child_list)) {

and now it's solved..  only a problem of the ->      !
thanks to all community! :D
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

Bruce Morgan

  • Full Member
  • ***
  • Posts: 672
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #9 on: June 23, 2011, 01:05:31 am »
Could someone post the corrected file?

Bruce

zanardi

  • Contributing Developer
  • Full Member
  • *
  • Posts: 878
    • GiBiLogic
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #10 on: June 23, 2011, 11:23:02 am »
Well, since everyone seems to think the old way is better, i'll just revert the change for the next release.
--
Francesco (zanardi)
http://extensions.gibilogic.com
@gibilogic on Twitter

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #11 on: June 24, 2011, 11:16:39 am »
@zanardi,

just my opinion: If VM 1.1.9 with or without the '!' has just a few neglectable 'bugs' now, wouldn't it be better to leave it as it is. VM 1.1.9 is EOL. Investing time and brain would only be necessary, if a serious problem (security issue) would occur, like sql injection or other things.
Why: Changes in the code need often need changes in the theme or in modules or other extensions. I think the most theme and extension developers do not invest a lot of time into further developement for old (EOL) code. The idea of the oscommerce developers to declare 2.3.1 as final and invest all efforts to develop the new 3.xx version, in case of VM 1.1.xx, that would mean 1.1.9 to declare as final and put all effort on 2.xx would be the better way. But as already said, just my opinion.

mtovarnet

  • Beginner
  • *
  • Posts: 1
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #12 on: June 24, 2011, 20:08:55 pm »
Thank you

is only dellete "!" character

Gracias

i've got the same problem here when i've update 1.1.8 to 1.1.9 ..

I only change the new:
elseif( $num_rows == 0 && empty($product_type_id) && empty($child_list)) {

to the old line:
elseif( $num_rows == 0 && empty($product_type_id) && !empty($child_list)) {

and now it's solved..  only a problem of the ->      !
thanks to all community! :D

Reincha

  • Jr. Member
  • **
  • Posts: 137
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #13 on: June 26, 2011, 13:08:32 pm »
hi!
Had the same problem and also added ! to fix it for now, but i actually think the new code is correct. i think there is a problem with $child_list because if child_list is NOT empty e.g - !empty($child_list) - it shouldn't return that category is empty.

Correct me if i'm wrong.

update:
calling for $child_list returns:

Notice: Undefined variable: child_list in ...

veredanet

  • Beginner
  • *
  • Posts: 5
Re: Bug in Virtuemart 1.1.9 with category module
« Reply #14 on: June 26, 2011, 23:06:13 pm »
I try the last solution, and it works but not at all. The category tree appears but the link of the subcategory doesn't work.

i apreciate an actualization