lessphp icon indicating copy to clipboard operation
lessphp copied to clipboard

Undefined property: stdClass::$parent

Open dtdesign opened this issue 11 years ago • 2 comments

lessc.inc.php (2056): Undefined property: stdClass::$parent

This issue is caused by a superflous closing curled bracket, in that case $this->env has no parent property.

I've fixed this issue by appending an additional check to properly throw an exception rather than raising a PHP error.

old: if (!is_null($this->env->parent)) new: if (!property_exists($this->env, 'parent') || !is_null($this->env->parent))

dtdesign avatar Jun 27 '13 11:06 dtdesign

This fix appears to work for me!

I'm using this library via the LESS Drupal module; so my steps to reproduce are:

  1. Click the Flush LESS Files button at admin/config/development/less
  2. Load a page.
  3. Check the log messages at admin/reports/dblog.

mparker17 avatar Jul 30 '13 23:07 mparker17

You can also change new stdclass; to new \stdclass();

garciajoem4 avatar May 25 '21 02:05 garciajoem4