M2.X在windows机中安装出现报错Unable to apply data patch Magento\Theme\Setup\Patch\Data\RegisterThemes

作者:yuan... 点击数: 0 收藏到会员中心
最后编辑时间: 2022-10-09 13:09

05202130_01.jpg

执行常规安装过程中出现这个问题

 Unable to apply data patch Magento\Theme\Setup\Patch\Data\RegisterThemes for module Magento_Theme. Original excepti
  on message: Wrong file

需要修改文件

\vendor\magento\framework\Image\Adapter\Gd2.php



在M2版本2.4.5中,此问题依然存在,但此文件位于

\lib\internal\Magento\Framework\Image\Adapter\Gd2.php

下的大约94行内容从

   private function validateURLScheme(string $filename) : bool
    {
        $allowed_schemes = ['ftp', 'ftps', 'http', 'https'];
        $url = parse_url($filename);
        if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes)) {
            return false;
        }

        return true;
    }

    private function validateURLScheme(string $filename) : bool
    {
        $allowed_schemes = ['ftp', 'ftps', 'http', 'https'];
        $url = parse_url($filename);
        //if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes)) {
        if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes) && !file_exists($filename)) {
            return false;
        }

        return true;
    }

完成此问题修复

请登录已经激活账号继续浏此文章所有内容!
会员中心

已经有帐号啦 !赶紧同小伙伴们愉快地玩耍吧

立即登录

还没有账号? 马上注册一个新帐户

注册账号
内容说明:
如您需要转载本文请保留以下信息是对作者发文的支持与尊重:

M2.X在windows机中安装出现报错Unable to apply data patch Magento\Theme\Setup\Patch\Data\RegisterThemes 来源于 https://www.magentola.com/news-read-222.html
上一篇:M2奇葩问题:从M2.3升级到M2.4搜索无结果
下一篇:M2网站样式混乱出错的解决方法
相关内容
产品推荐