Skip to content

Bug with timber v1 #5

@ninogal

Description

@ninogal

Hi, I noticed that this bug occurs when using the plugin with Timber v1.

in clear-cache-for-timber.php

function clear_cache_for_timber_clear_cache() {
    if (class_exists('Timber\Cache\Cleaner')) {
        return Timber\Cache\Cleaner::clear_cache_twig();
    }
    else if (class_exists('Timber\\Integrations\\Command')) {
        return \Timber\Integrations\Command::clear_cache();
    }
    else {
        return TimberCommand::clear_cache();
    }
}

Basically, the first check you do doesn't work because it can't find the clear_cache_twig() method and results in a 500 error. To quickly fix it, I swapped the first two if statements, but I'm sure there's a better way to fix it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions