x97wehner Posted April 22 Posted April 22 Hi, I have a module with a php 8 error that I just can't figure out how to resolve. I'm sure it's very easy, but I'm struggling. Anyone know how to resolve? @datakick? This is the error: This is the code snippet causing issue: public function __get($name) { if ($name === 'module') { return $this->module = Module::getInstanceByName('rg_smartpopup'); } if ($name === 'popup') { if (!(int) $this->id_popup) { throw new PrestaShopException('The property `id_popup` is required.'); } return $this->popup = new RgSpPopup((int) $this->id_popup, (int) $this->id_lang); } return parent::__get($name); // Ensure compatibility with ObjectModelCore }
datakick Posted April 22 Posted April 22 First line should look like this: public function &__get($name)
x97wehner Posted April 22 Author Posted April 22 10 hours ago, datakick said: First line should look like this: public function &__get($name) Thanks so much!
x97wehner Posted April 23 Author Posted April 23 One more question for you @datakick. I've updated to PHP 8.3 now and all is functioning correctly. When I review error logs though, I have many deprecation warnings around controllers::$admin_webpath making dynamic properties. Is there an easy fix to resolve those? Here is an example of just one:
datakick Posted April 23 Posted April 23 There is some (probably module/override) code that access this property on front-office controllers. You have to figure out what code is that, and fix it -- it should probably work with back-office controllers only. Look at stacktrace for this error to figure out what code attempts to access the property. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now