Skip to content

"Compiling Error, function 'compiler' already exists." error is surplus to requirement #182

@niaccurshi

Description

@niaccurshi

For reason that are specific to my usage, I tap in to the compiler code that is in the class-wp-scss.php file to compile other specific .scss files. Unfortunately the recent change to add a compiler error has created what seems to be a needless error message. The compiler still runs, it just throws up an error that the compiler has already been created within the class.

The function below already checks to make sure that it's not being created more than once, that surely only requires a silent moving on through the processing of the code? I would suggest we remove the "else" statement from this and let the compile function end silently if the compiler function has already been instantiated before.

if (!function_exists( 'compiler' )) {
  function compiler($in, $out, $instance) {
    global $scssc, $cache;
    if (!file_exists($cache)) {
      mkdir($cache, 0644);
    }
   [...]
}else{
  $errors = array (
    'file' => 'SCSS compiler',
    'message' => "Compiling Error, function 'compiler' already exists."
  );
  array_push($this->compile_errors, $errors);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions