LessphpCompiler::compile should return parser instead of CSS string

Created on 22 May 2023, over 1 year ago

Problem/Motivation

When using the LessPhp compiler, the following error is thrown:
> Error: Call to a member function getCss() on string in Drupal\scss_compiler\ScssCompilerService->compile() (line 471 of modules/contrib/scss_compiler/src/ScssCompilerService.php).

This is caused by the fact that the LessphpCompiler::compile method returns the CSS string by calling "getCss" instead of returning the parser as is done in other compilers.

Steps to reproduce

1. setup the module to use the LessphpCompiler
2. visit a page that uses a .less file

Proposed resolution

Return "$this->parser" instead of "$this->parser->getCss()" in LessphpCompiler::compile.

Remaining tasks

Implement the change.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇩🇪Germany semiaddict

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024