1

I think I remember seeing a delete button at some point recently on CE 2.1.2 when I go to Content > Designs > Themes > select a theme. Now, I don't for any themes I have (default ones and a custom one). Upon looking at the code, a theme can be deleted if the below condition is satisfied.

/**
 * Check if theme is deletable
 *
 * @return bool
 */
public function isDeletable()
{
    return $this->isEditable();
}

/**
 * Check if theme is editable
 *
 * @return bool
 */
public function isEditable()
{
    return self::TYPE_PHYSICAL != $this->getType();
}

I can't make sense of this because a theme is typically saved as TYPE_PHYSICAL, and I don't see how it's ever changed. Therefore, isEditable() doesn't seem like it would ever return true because it's evaluating 0 != 0.

It appears themes were designed to be added in CLI and perhaps managed entirely via CLI? I have a custom theme record in the theme table, but the theme files are actually not there. I'm trying to clean up the database of this remnant data and re-install a new theme. Any ideas?

1 Answer 1

1

Found the answer. See Magento\Theme\Controller\Adminhtml\System\Design\Theme\Delete:execute. It says ...

Only virtual theme is possible to delete

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.