gpt4 book ai didi

javascript - 未捕获的类型错误 : Cannot read property 'model' of undefined in builder. js

转载 作者:数据小太阳 更新时间:2023-10-29 03:59:56 24 4
gpt4 key购买 nike

请帮我解决这个错误

Uncaught TypeError: Cannot read property 'model' of undefined" in Builder.js.

我正在使用 Elegant 的 Extra 主题,我刚刚将我的 Wordpress 更新到 4.5 版。当我尝试删除 Divi Builder 中的某些部分时,出现此错误。

我不知道如何解决这个问题。 Uncaugth Error Elegant Theme

最佳答案

我在 Divi 主题上遇到了这个错误。这就是我修复它的方式...它可能也适用于您。

Divi/includes/builder/script/builder.js

替换这些行(共 2 行)

if ( view['model']['attributes']['parent'] === parent_id )

用这些线

if ( view !== undefined && view['model']['attributes']['parent'] === parent_id )

并替换这2个函数

getNumberOf : function( element_name, module_cid ) {
var views = this.get( 'views' ),
num = 0;

_.each( views, function( view ) {
var type = view['model']['attributes']['type'];

if ( view['model']['attributes']['parent'] === module_cid && ( type === element_name || type === ( element_name + '_inner' ) ) )
num++;
} );

return num;
},

getNumberOfModules : function( module_name ) {
var views = this.get( 'views' ),
num = 0;

_.each( views, function( view ) {
if ( view['model']['attributes']['type'] === module_name )
num++;
} );

return num;
},

有了这些

getNumberOf : function( element_name, module_cid ) {
var views = this.get( 'views' ),
num = 0;

_.each( views, function( view ) {
if(view !== undefined){
var type = view['model']['attributes']['type'];

if ( view['model']['attributes']['parent'] === module_cid && ( type === element_name || type === ( element_name + '_inner' ) ) )
num++;
}
} );

return num;
},

getNumberOfModules : function( module_name ) {
var views = this.get( 'views' ),
num = 0;

_.each( views, function( view ) {
if(view !== undefined){
if ( view['model']['attributes']['type'] === module_name )
num++;
}
} );

return num;
},

关于javascript - 未捕获的类型错误 : Cannot read property 'model' of undefined in builder. js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36652839/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com