Author Topic: [fixed]VM 2.0.21g: Category id 0 not published  (Read 23598 times)

z-analysts

  • Jr. Member
  • **
  • Posts: 162
[fixed]VM 2.0.21g: Category id 0 not published
« on: June 26, 2013, 23:06:14 pm »
Hi,
I just upgraded to 2.0.21g from 2.0.21f and now get "Category id 0 not published" when I display my top level categories page. To see the error, please go to http://zclientdev.net/solfairtrade and click on the Products image.

VM 2.0.21g
PHP 5.3.16
Joomla 2.5.11

Please advise.

Thank you!

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10094
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM 2.0.21g: Category id 0 not published
« Reply #1 on: June 27, 2013, 11:17:51 am »
thanks.

search in the view.html.php of your category/categories view for
Code: [Select]
if(!$category->published){
vmInfo('COM_VIRTUEMART_CAT_NOT_PUBL',$category->category_name,$categoryId);
return false;
}

just complete it with
Code: [Select]
if($category->virtuemart_id!==0 and !$category->published){
vmInfo('COM_VIRTUEMART_CAT_NOT_PUBL',$category->category_name,$categoryId);
return false;
}

Will be in the final then.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

z-analysts

  • Jr. Member
  • **
  • Posts: 162
Re: VM 2.0.21g: Category id 0 not published
« Reply #2 on: June 27, 2013, 16:10:04 pm »
Hi Max,

I replaced the code as you indicated but still get the same error. :(


Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10094
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM 2.0.21g: Category id 0 not published
« Reply #3 on: June 28, 2013, 02:01:19 am »
nice page, really! try the attached file, is for the categories view.

[attachment cleanup by admin]
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

z-analysts

  • Jr. Member
  • **
  • Posts: 162
Re: VM 2.0.21g: Category id 0 not published
« Reply #4 on: June 28, 2013, 02:18:13 am »
Thank you for the site compliment Milbo!

I uploaded your file but still get the same error. Is there something else I should be looking at?

Thanks,
Tim

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: VM 2.0.21g: Category id 0 not published
« Reply #5 on: June 28, 2013, 10:30:20 am »
Did you give Virtuemart a menu item in joomla menu system?

Lee2008

  • Beginner
  • *
  • Posts: 9
Re: VM 2.0.21g: Category id 0 not published
« Reply #6 on: June 28, 2013, 11:07:48 am »
I put the file in..
public_html/components/com_virtuemart/views/categories

I can't see any change.
Is there any other thing I must do?



Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10094
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM 2.0.21g: Category id 0 not published
« Reply #7 on: June 28, 2013, 13:10:53 pm »
Strange for me it works
Code: [Select]
if(!$category->published){
vmInfo('COM_VIRTUEMART_CAT_NOT_PUBL',$category->category_name,$categoryId);
return false;
}
This is just a check to prevent unpublished categories to be shown if someone is changing the id in the link or so. The problem is just that I forgot that category_id= 0 means, "show all". So an exception should be enough. I just sent the file, in case you did not understand what to replace. I dont know your skill :-)
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Lee2008

  • Beginner
  • *
  • Posts: 9
Re: VM 2.0.21g: Category id 0 not published
« Reply #8 on: June 28, 2013, 14:28:25 pm »
Hi,

I can publish the menu link in my top menu and if I set it to "virtuemart categories layout" and set as "top level" then the error is:
Category id 0 not published
index.php?option=com_virtuemart&view=categories&virtuemart_category_id=0
I can link to specific category and the images appear, but if clicked I am taken back to template front page.
hellboardriders.com

So I am not sure what I have set wrong.
Any advice appreciated.

Regards Lee

z-analysts

  • Jr. Member
  • **
  • Posts: 162
Re: VM 2.0.21g: Category id 0 not published
« Reply #9 on: June 28, 2013, 16:16:07 pm »
franzpeter: yes, I gave the top level category a joomla menu option. If you go to my test site, http://zclientdev.net/solfairtrade, then click on any image, then click on Products in the top menu you will get the same error.

milbo: you said that your fix works for you but on which site does it work? does my site display properly for you?

thank you!

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10094
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM 2.0.21g: Category id 0 not published
« Reply #10 on: June 28, 2013, 16:52:10 pm »
Maybe you replaced the view.html.php in the category view, but is for the categories view,..

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

z-analysts

  • Jr. Member
  • **
  • Posts: 162
Re: VM 2.0.21g: Category id 0 not published
« Reply #11 on: June 28, 2013, 17:11:02 pm »
Thank you for your concern Milbo however the file was correctly placed.

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: VM 2.0.21g: Category id 0 not published
« Reply #12 on: June 28, 2013, 18:57:32 pm »
I did try it out and if I add the VM categories layout to a Joomla menu and select that in the frontend, I receive the same message: category id 0 not published.

Lee2008

  • Beginner
  • *
  • Posts: 9
Re: VM 2.0.21g: Category id 0 not published
« Reply #13 on: June 28, 2013, 23:44:57 pm »
Hi,

I posted my path above, it is in:
public_html/components/com_virtuemart/views/categories

If I turn off Joomla SEF on configuration.
I can find my products Eg:
http://hellboardriders.com/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=12&virtuemart_category_id=2&Itemid=198

My Main Menu shop url does not work:
http://hellboardriders.com/index.php?option=com_virtuemart&view=categories&virtuemart_category_id=0&Itemid=198

Error is :
Category id 0 not published


Your help is appreciated

Regards Lee


Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10094
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM 2.0.21g: Category id 0 not published
« Reply #14 on: June 29, 2013, 17:39:02 pm »
you can also just remove the info message and the return. The fix works 100%. Franzpeter got a new version and has not anylonger the problem.
Code: [Select]
if(!$category->published){
vmInfo('COM_VIRTUEMART_CAT_NOT_PUBL',$category->category_name,$categoryId);
return false;
}
just remove this in your view.html.php.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/