[fixed]VM 2.0.21g: Category id 0 not published

Started by z-analysts, June 26, 2013, 23:06:14 PM

Previous topic - Next topic

z-analysts

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

thanks.

search in the view.html.php of your category/categories view for

if(!$category->published){
vmInfo('COM_VIRTUEMART_CAT_NOT_PUBL',$category->category_name,$categoryId);
return false;
}


just complete it with

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

z-analysts

Hi Max,

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


Milbo

nice page, really! try the attached file, is for the categories view.

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

z-analysts

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

Did you give Virtuemart a menu item in joomla menu system?

Lee2008

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

Strange for me it works

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 :-)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Lee2008

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

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

Maybe you replaced the view.html.php in the category view, but is for the categories view,..

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

z-analysts

Thank you for your concern Milbo however the file was correctly placed.

franzpeter

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

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

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.

if(!$category->published){
vmInfo('COM_VIRTUEMART_CAT_NOT_PUBL',$category->category_name,$categoryId);
return false;
}

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