VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Stas40 on September 07, 2013, 20:43:05 PM

Title: PHP Fatal error: Class 'JAccess' not found ....
Post by: Stas40 on September 07, 2013, 20:43:05 PM
My config : Joomla 1.5 Php 5.3

After Upgrade from 2.0.18 to current 2.0.22c my site down with fatal error.

PHP Fatal error:  Class 'JAccess' not found in ...\administrator\\components\\com_virtuemart\\helpers\\vmview.php on line 84, referer: /administrator/index.php

Can you help me ?
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: jenkinhill on September 07, 2013, 20:51:20 PM
I wonder if this is caused by using J1.5  - Joomla 1.5 is no longer supported.  http://virtuemart.net/news/list-all-news/426-end-of-life-for-virtuemart-11-heidelpay-now-in-virtuemart-2012
"We decided to declare now the end of life for VirtueMart 1.1, and that the version 2 of VirtueMart is not any longer maintaining joomla 1.5 compatibility." 4 October 2012
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: alatak on September 07, 2013, 21:49:48 PM
Hello

The reason is that we added ACL (Access Control List) to control the access to the VirtueMart administration pages. This class is only available in Joomla 2.5 , and we are not checking the Joomla version.

But why are you still using J1.5?
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: Stas40 on September 07, 2013, 22:53:13 PM
Quote from: alatak on September 07, 2013, 21:49:48 PM
The reason is that we added ACL (Access Control List) to control the access to the VirtueMart administration pages. This class is only available in Joomla 2.5
Is it simply to disable this check of access (php hack) or add this class (or acl function to class JAccess) to j1.5 folder ?
I can do it if it is used only in same php files.

Quote from: alatak on September 07, 2013, 21:49:48 PM
But why are you still using J1.5?
I have old portal with forum and shop (double login - joomla+ phpbb3), many old custom plugins (+ russian pay and delivery cost vmpeyment & shipment plugins) - they all are not works with J2.5  . It will be a hard word to make it work with j2.5 or j3 for me.
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: Maxim Pishnyak on September 08, 2013, 10:01:49 AM
Quote from: Stas40 on September 07, 2013, 22:53:13 PM
I have old portal with forum and shop (double login - joomla+ phpbb3), many old custom plugins (+ russian pay and delivery cost vmpeyment & shipment plugins) - they all are not works with J2.5  . It will be a hard word to make it work with j2.5 or j3 for me.
I would try to disagree with you. What old stuff in your web site actually is NOT present in more fresh extensions?
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: alatak on September 08, 2013, 12:57:19 PM
Hello
We will implement a fallback.
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: Stas40 on September 08, 2013, 17:09:04 PM
Quote from: alatak on September 08, 2013, 12:57:19 PM
We will implement a fallback.
Thanks.
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: Stas40 on September 08, 2013, 17:15:01 PM
Quote from: Maxim Pishnyak on September 08, 2013, 10:01:49 AM
...
I would try to disagree with you. What old stuff in your web site actually is NOT present in more fresh extensions?
It is custom development plugins. It not need for others sites. - Online grabber picture, temperature, humidity etc... and picture of growing plants online. (Sorry for my english :) )
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: alatak on September 08, 2013, 17:30:59 PM
Hello

I looked to see how to implement a fallback.
It is not that easy.

And as mentioned jenkinhill we announced that j1.5 is obsolete, almost a year ago.

Actually the best is that somebody provides a dummy Jaccess file , that will be placed in that folder /libraries/joomla/access
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: Stas40 on September 09, 2013, 14:43:02 PM
Quote from: alatak on September 08, 2013, 17:30:59 PM
...
Actually the best is that somebody provides a dummy Jaccess file , that will be placed in that folder /libraries/joomla/access
Thanks, I try to do it.
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: Stas40 on September 09, 2013, 15:57:10 PM
I think the last version was 2.0.18, which works with j1.5 .
When I add access.php - the next fatal error was JUser::authorise() in .../com_virtuemart/helpers/adminui.php . I add authorise() function to JUser j1.5 class :)
And now I get "JERROR_ALERTNOAUTHOR" in BE (i don't add any permissions to admin in access.php ;) ) and a new hard work with front end :)

I try to go back to last version 2.0.18 . Thanks ta All !
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: madmarx on September 22, 2013, 09:24:23 AM
hi !
ten minutes and vm 2.0.22c work on j 1.5:


comment line 68-70 on wmview.php

//if (!$this->canDo->get('vm.'.$view)) {
//JFactory::getApplication()->redirect( 'index.php?option=com_virtuemart', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
//}


and add return:
/*
* Get the ACL actions
*/
public static function getActions() {
$user<->= JFactory::getUser();
$result>= new JObject;
return $result;



adminui.php line 254 comment: and on next line {

//if ($user->authorise('core.admin', 'com_virtuemart') || $user->authorise('vm.'.$link ['view'], 'com_virtuemart') || $target.................
{


now all work

....oops but is not all ....  i not see admin buttons: apply, new ...etc ...... thinking....
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: madmarx on September 22, 2013, 10:19:01 AM
and in vmview.php:
inside function comment all 3 if's
/*
* set all commands and options for BE default.php views
* return $list filter_order and
*/
function addStandardDefaultViewCommands($showNew=true, $showDelete=true, $showHelp=true) {
$view = JRequest::getCmd('view', JRequest::getCmd('controller','virtuemart'));

JToolBarHelper::divider();
//if ($this->canDo->get('core.admin') || $this->canDo->get('vm.'.$view.'.edit.state')) {
   JToolBarHelper::publishList();
   JToolBarHelper::unpublishList();
//}
etc ...


and in function addStandardEditViewCommands comment

//if ($this->canDo->get('core.admin') || $this->canDo->get('vm.'.$view.'.edit')) {

and close
//{

all admin function works
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: Maxim Pishnyak on September 22, 2013, 11:47:30 AM
VM works on Joomla2.5. J1.5 is NOT safe for using on the internet web sites.
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: stawebnice on February 10, 2014, 21:20:02 PM
Hi,

What if I want to migrate from Joomla! 1.5? I installed VM 2.0.18 and migrated, but it did not migrate the parameters...I have eshop with over 3000 items and all of them have 2-3 variants that differ with price and they were not migrated...
I hoped that the latest VM version might include that in the migration script, but I am not able to install it thanks to what was previously said.

Please help. Is there any way to migrate everything from Joomla 1.5.26 to VM 2.0.26d or at least little older?

Thank you!

Petra
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: Milbo on February 11, 2014, 10:30:41 AM
Of course there is a way. The bigger problem is joomla. If you are using one of the free tools, then you have to install it on j1.5. Or just use the migrator of daycounts http://extensions.virtuemart.net/import-export/virtuemart-migrator-detail.
The advantage of this migrator is that it works the "normal" way. Install a j2.5 in a subdirectory on your webpage and do the migration directly from your old store. It is more need for joomla, then for virtuemart.

and why do you not install the latest version? vm2.0.26d? The core also ports the product attributes. 3000 products is not a big deal.
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: stawebnice on February 11, 2014, 12:58:28 PM
Hi,
I have tried to install the latest virtuemart but it cannot be installed on Joomla 1.5 - it fails...so I am not able to use the migration within it.
I have purchased Migrate Me to migrate my joomla!. But we also purchased new template for virtuemart 2.0.18 and I am not sure it would work fine with the latest virtuemart as well, but I will try it as soon as I migrate all data.
Thanks for recommending the migration tool, I'll look at it.
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: stawebnice on February 11, 2014, 16:03:06 PM
I tried installing the Migrator on clean Joomla 2.5.18 and then on 2.5.9 but anytime I try to access the component from the menu, I get these errors:

Warning: require(../administrator/components/com_virtuemart/helpers/config.php) [function.require]: failed to open stream: No such file or directory in ../administrator/components/com_vmmigrate/models/base.php on line 50

Fatal error: require() [function.require]: Failed opening required '../test2/administrator/components/com_virtuemart/helpers/config.php' (include_path='.:/data/web/virtuals/53361/virtual') in ../test2/administrator/components/com_vmmigrate/models/base.php on line 50

Previously I installed it on Joomla 2.5.9 with Virtuemart 2.0.18 (complete package from Templatemonster) and it worked fine, but the migration was not complete (missing prices, images etc.)...so I thought it should be installed on clean Joomla 2.5 but now I am completely lost...

Please advise...
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: Milbo on February 11, 2014, 17:57:26 PM
You must install joomla 2.5.18 ! 18! then virtuemart 2.0.26D, then install the migrator com_vmmigrate. then configure it and start with it... You can repeat the process. It is resuming and in many steps.
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: stawebnice on February 11, 2014, 20:31:46 PM
Thank you! ok, I'll try. lets hope it will not affect the template too much. Templatemonster declares compatibility of templates with certain versions of Joomla! and VM and with higher versions in may not work properly...
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: stawebnice on February 12, 2014, 10:57:06 AM
Hi Milbo,

so I tried the migrator with the latest Joomla and Virtuemart. I migrated products and other things, but there is a problem with product categories>

When I checked at the backend, only part of them was imported, some were imported correctly (http://imtp.me/74vh0250b.p)with the parent category assigned, but the major problem is that the products don't have the categories assigned, so they do not show in front-end at all.

Here is the example of the error log>
Could not read source file for category:72031 (/components/com_virtuemart/shop_image/category/resized/RS_125_01_4ffb481d6d717.png)
Duplicate entry '65535' for key 'PRIMARY' SQL=INSERT INTO `znskt_virtuemart_categories` (`virtuemart_category_id`,`virtuemart_vendor_id`,`category_template`,`category_layout`,`category_product_layout`,`products_per_row`,`limit_list_step`,`limit_list_initial`,`ordering`,`published`,`created_on`,`modified_on`) VALUES ('72031','1','0','0','0','0','10','0','1','1','2012-07-02 13:24:47','2012-07-09 21:07:41')
Duplicate entry '65535-109' for key 'i_virtuemart_category_id' SQL=INSERT INTO `znskt_virtuemart_category_medias` (`virtuemart_category_id`,`virtuemart_media_id`,`ordering`) VALUES ('72031','109','0')
Item with id 72031 migrated: RS 125 01,1 media(s)

Can you possibly advise what is wrong?

Here is the complete log for migration of product categories>

[attachment cleanup by admin]
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: stawebnice on February 12, 2014, 21:31:40 PM
So the problem with importing categories was solved - there was a problem with data type in column virtuemart_category_id which was set to smallint in my database so it was not able to migrate categories with high ids...

however, the category images are still not imported....it's weird. I set the rights to 755 for folders and 644 for files. And some images for products are imported and some are not...could this be a database problem too?
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: stawebnice on February 12, 2014, 22:02:27 PM
problem with medias solved - images were in a different folder than they should be (not in resized)
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: cimran on February 13, 2014, 05:02:15 AM
Quote from: madmarx on September 22, 2013, 09:24:23 AM
hi !
ten minutes and vm 2.0.22c work on j 1.5:


comment line 68-70 on wmview.php

//if (!$this->canDo->get('vm.'.$view)) {
//JFactory::getApplication()->redirect( 'index.php?option=com_virtuemart', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
//}


and add return:
/*
* Get the ACL actions
*/
public static function getActions() {
$user<->= JFactory::getUser();
$result>= new JObject;
return $result;



adminui.php line 254 comment: and on next line {

//if ($user->authorise('core.admin', 'com_virtuemart') || $user->authorise('vm.'.$link ['view'], 'com_virtuemart') || $target.................
{


now all work

....oops but is not all ....  i not see admin buttons: apply, new ...etc ...... thinking....
When i insert * Get the ACL actions
*/
public static function getActions() {
$user<->= JFactory::getUser();
$result>= new JObject;
return $result;[/code]

I get error
Parse error: syntax error, unexpected T_PUBLIC in /public_html/administrator/components/com_virtuemart/helpers/vmview.php on line 73

Please help
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: Milbo on February 13, 2014, 14:39:36 PM
Quote from: stawebnice on February 12, 2014, 21:31:40 PM
So the problem with importing categories was solved - there was a problem with data type in column virtuemart_category_id which was set to smallint in my database so it was not able to migrate categories with high ids...

however, the category images are still not imported....it's weird. I set the rights to 755 for folders and 644 for files. And some images for products are imported and some are not...could this be a database problem too?

whoohaa, the id was more than 65000? I changed it now to mediumint, that should avoid stuff like this.
Title: Re: PHP Fatal error: Class 'JAccess' not found ....
Post by: stawebnice on February 14, 2014, 13:45:56 PM
well, it's a motorcycle fairing store with over 170 categories and 1700 products...:) some ids very already imported from the original non-virtuemart store...man must be ready for anything :)