News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Class "JResponse" not found

Started by Gomad, July 03, 2022, 15:30:04 PM

Previous topic - Next topic

Gomad

Hello

Joomla4 version 4.1.5 using actual latest VM 4.0.2

Having the "Show the pdf view icon" function enabled in the frontshop trying to get a pdf of the product page the result is: 0 - Class "JResponse" not found

How to solve this?

Being logged in the front end as superuser in a product page clicking the button "modify this product" the result is: 0 - Call to undefined method Joomla\CMS\Router\SiteRouter::setMode()

Thank you
best regards

Milbo

Quote from: Gomad on July 03, 2022, 15:30:04 PM
Having the "Show the pdf view icon" function enabled in the frontshop trying to get a pdf of the product page the result is: 0 - Class "JResponse" not found
Please enable your joomla debug. You can configure the debug plugin of joomla so, that only superadmins can see it. so you can hide it from customers.

Quote from: Gomad on July 03, 2022, 15:30:04 PM
Being logged in the front end as superuser in a product page clicking the button "modify this product" the result is: 0 - Call to undefined method Joomla\CMS\Router\SiteRouter::setMode()

I dont know, but with joomla debug enabled, you should see the backtrace,... just post this backtrace for both cases, then I can what is actually calling the JResponse and the setMode
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Darko F.

This is old post I see
But I have same problem and here are my data I hope are in any help.
VirtueMart 4.0.7 10701

Joomla! Version   4.2.2
PHP Version   8.0.23
Identity   user
Response   200
Template   cassiopeia
Database   
ServermysqlVersion10.4.24-MariaDB-cll-lve-logCollationutf8_general_ciConn Collationutf8mb4_general_ci

$_GET
array:3 [ "view" => "category" "virtuemart_category_id" => "0" "virtuemart_manufacturer_id" =>...
$_POST
[]
$_SESSION
array:1 [ "joomla" => "TzoyNDoiSm9vbWxhXFJlZ2lzdHJ5XFJlZ2lzdHJ5IjozOntzOjc6IgAqAGRhdGEiO086ODoic3R...
$_COOKIE
array:41 [ "manufacturer40" => "1" "manufacturer5" => "1" "manufacturer48" => "0" "manufactu...
$_SERVER
array:52 [ "PATH" => "/usr/local/bin:/bin:/usr/bin" "HTTP_ACCEPT" => "text/html,application/xhtm...



0 Call to undefined method Joomla\CMS\Router\SiteRouter::setMode()
Call stack
#   Function   Location
1   ()   JROOT/components/com_virtuemart/virtuemart.php:72
2   require_once()   JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
3   Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}()   JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
4   Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch()   JROOT/libraries/src/Component/ComponentHelper.php:355
5   Joomla\CMS\Component\ComponentHelper::renderComponent()   JROOT/libraries/src/Application/SiteApplication.php:200
6   Joomla\CMS\Application\SiteApplication->dispatch()   JROOT/libraries/src/Application/SiteApplication.php:241
7   Joomla\CMS\Application\SiteApplication->doExecute()   JROOT/libraries/src/Application/CMSApplication.php:294
8   Joomla\CMS\Application\CMSApplication->execute()   JROOT/includes/app.php:61
9   require_once()   JROOT/index.php:32

error - Uncaught Throwable of type Error thrown with message "Call to undefined method Joomla\CMS\Router\SiteRouter::setMode()". Stack trace: #0 [ROOT]/libraries/src/Dispatcher/LegacyComponentDispatcher.php(71): require_once() #1 [ROOT]/libraries/src/Dispatcher/LegacyComponentDispatcher.php(73): Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() #2 [ROOT]/libraries/src/Component/ComponentHelper.php(355): Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() #3 [ROOT]/libraries/src/Application/SiteApplication.php(200): Joomla\CMS\Component\ComponentHelper::renderComponent() #4 [ROOT]/libraries/src/Application/SiteApplication.php(241): Joomla\CMS\Application\SiteApplication->dispatch() #5 [ROOT]/libraries/src/Application/CMSApplication.php(294): Joomla\CMS\Application\SiteApplication->doExecute() #6 [ROOT]/includes/app.php(61): Joomla\CMS\Application\CMSApplication->execute() #7 [ROOT]/index.php(32): require_once('/home/xxx/do...') #8 {main}
There in no problem if you fall. Problem is if you don't get up

Milbo

#3
Alright. Thank you.
Added a fix, just open the file components/com_virtuemart/virtuemart.php and set there an "if for j3/j4"
Just use the code below and replace the lines 72, 73.

if(JVM_VERSION<4){
$router = $app->getRouter();
$router->setMode(0);
}


It is just for the manger mode in FE. Maybe you get now other problems in the FE manager mode. But the url should just not be routed and there are no routes defined and so it should work in j4. I think that was differen in j3, it was always doing fallback routings.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Darko F.

Hi, I test J4 for now and I can enter edit from front page product after these fix so hooray (never use front edit personally but is good to know working now in J4)

As for PDF view i get 

Error  TypeError
HTTP 500 Whoops, looks like something went wrong.
Cannot access offset of type string on string
Exceptions 2Stack Traces 2
TypeError
in domains/mysite/private_html/libraries/src/Document/HtmlDocument.php (line 592)
$options['type'] = $args[1];           
$options['name'] = $args[2] ?? null;           
$options['title'] = $args[3] ?? null;        }       
parent::$_buffer[$options['type']][$options['name']][$options['title']] = $content;        return $this;    }    /**

HtmlDocument->setBuffer()
/private_html/libraries/src/Document/HtmlDocument.php (line 565)
HtmlDocument->getBuffer()
in/private_html/libraries/src/Document/HtmlDocument.php (line 848)
HtmlDocument->_renderTemplate()
in /private_html/libraries/src/Document/HtmlDocument.php (line 633)
HtmlDocument->render()
in /private_html/libraries/src/Document/ErrorDocument.php (line 139)
ErrorDocument->render()
in /private_html/libraries/src/Error/Renderer/HtmlRenderer.php (line 78)
HtmlRenderer->render()
in /private_html/libraries/src/Exception/ExceptionHandler.php (line 121)
ExceptionHandler::render()
in /private_html/libraries/src/Exception/ExceptionHandler.php (line 72)

ExceptionHandler::handleException()

in /private_html/libraries/src/Application/CMSApplication.php (line 323)

CMSApplication->execute()
in /private_html/includes/app.php (line 61)

require_once(//private_html/includes/app.php')

in /private_html/index.php (line 32)
Error
Class "JResponse" not found

I will test J3 now

There in no problem if you fall. Problem is if you don't get up

Darko F.

In J3
Front edit don't work PDF work as should.
Front edit error

If difficulties persist, please contact the System Administrator of this site and report the error below.

0 Class "PX" not found
There in no problem if you fall. Problem is if you don't get up