Author Topic: 404 Error Handling: 0 - Using $this when not in object context  (Read 985 times)

kaiserdom

  • Jr. Member
  • **
  • Posts: 74
  • A beginner
404 Error Handling: 0 - Using $this when not in object context
« on: October 12, 2018, 19:59:52 pm »
I'm running Virtuemart 3.4.2 and when I click to link of a product that has been deleted, the system brings this error "0 - Using $this when not in object context" instead of redirecting to "404 Error-Product Not Found".

Virtuemart 3.4.2
Joomla 3.8.13
PHP 7.1.22

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8433
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: 0 - Using $this when not in object context
« Reply #1 on: October 12, 2018, 20:39:17 pm »
just tested here  -- I get a proper message

you need to turn on Joomla debug and full error to find where this error is
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

kaiserdom

  • Jr. Member
  • **
  • Posts: 74
  • A beginner
Re: 0 - Using $this when not in object context
« Reply #2 on: October 12, 2018, 22:28:59 pm »
Unfortunately I'm not a developer. Could someone please take a look at the link?

 https://www.everhome.gr/products/υπνοδωμάτιο/σετ-πάπλωμα-satin-printed-205tc-1428-heidi-detail

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8433
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: 0 - Using $this when not in object context
« Reply #3 on: October 13, 2018, 10:48:29 am »
link helps no one .. without full error reporting on to say WHERE this error is occurring

http://forum.virtuemart.net/index.php?topic=121692.0

GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

kaiserdom

  • Jr. Member
  • **
  • Posts: 74
  • A beginner
Re: 0 - Using $this when not in object context
« Reply #4 on: October 19, 2018, 19:47:17 pm »
I'm receiving the existing errors

Notice: Trying to get property of non-object in /var/www/vhosts/everhome.gr/httpdocs/components/com_virtuemart/views/productdetails/view.html.php on line 81

Warning: Declaration of & CustomfieldsForAllFilter::getInstance($tagsArray = Array, $attrArray = Array, $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) should be compatible with & Joomla\CMS\Filter\InputFilter::getInstance($tagsArray = Array, $attrArray = Array, $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1, $stripUSC = -1) in /var/www/vhosts/everhome.gr/httpdocs/plugins/vmcustom/customfieldsforall/helpers/filter.php on line 0

Notice: Trying to get property of non-object in /var/www/vhosts/everhome.gr/httpdocs/plugins/vmcustom/customfieldsforall/customfieldsforall.php on line 815

kaiserdom

  • Jr. Member
  • **
  • Posts: 74
  • A beginner
Re: 0 - Using $this when not in object context
« Reply #5 on: October 19, 2018, 19:55:48 pm »
The code inside view.html.php
Code: [Select]
$product_model->withRating = $this->showRating = $ratingModel->showRating($virtuemart_product_id);
$product = $product_model->getProduct($virtuemart_product_id,TRUE,TRUE,TRUE,$quantity);
$this->assignRef('product', $product);

$last_category_id = shopFunctionsF::getLastVisitedCategoryId();

$customfieldsModel = VmModel::getModel ('Customfields');

line 81: if ($product->customfields){
$customfieldsModel -> displayProductCustomfieldFE ($product, $product->customfields);
}

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8433
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: 0 - Using $this when not in object context
« Reply #6 on: October 19, 2018, 22:51:55 pm »
they are only warnings/notices and 2 are not from VM

this has nothing to do with the subject of your post
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

kaiserdom

  • Jr. Member
  • **
  • Posts: 74
  • A beginner
Re: 0 - Using $this when not in object context
« Reply #7 on: October 19, 2018, 23:24:52 pm »
Ok thanks.

kaiserdom

  • Jr. Member
  • **
  • Posts: 74
  • A beginner
Re: 0 - Using $this when not in object context
« Reply #8 on: October 20, 2018, 11:13:11 am »
Is there a way to download VM 3.4.0 where everything worked just fine?

kaiserdom

  • Jr. Member
  • **
  • Posts: 74
  • A beginner
Re: 0 - Using $this when not in object context
« Reply #9 on: October 20, 2018, 16:08:45 pm »
It seems that the problem is coming from Virtuemart 3.4.2 «404 Error Handling». So I disabled it and created a custom Joomla 3.8.13 «404 redirection page».

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9726
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

kaiserdom

  • Jr. Member
  • **
  • Posts: 74
  • A beginner
Re: 404 Error Handling: 0 - Using $this when not in object context
« Reply #11 on: October 28, 2018, 19:01:01 pm »
Hello Max

Thank you for your help. This solution brings up the right message, but it redirects wrongly. The redirection page is something like a mix of non-found-product category view and product details view. Very weird.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9726
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: 404 Error Handling: 0 - Using $this when not in object context
« Reply #12 on: October 29, 2018, 08:59:37 am »
which is not possible. It should call the last correctly opened category
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/