vsoni
vsoni

Reputation: 497

Composer-view.js file gives me an error

I am getting this error. composer-view.js?ver=4.5.3:6 Uncaught TypeError: Cannot read property 'attributes' of undefined.

I get this after changing the code.

html2element: function(html) {
        var $template, attributes = {},
            template = html;
        $template = $(template(this.model.toJSON()).trim()), _.each($template.get(0).attributes, function(attr) {
            attributes[attr.name] = attr.value}), 
            this.$el.attr(attributes).html($template.html()), this.setContent(), 
            this.renderContent()
    },

Because of that I am not able to add updated or delete in my backend visiual Composor editor for my visual composer. I am using VC-4.8.4

Upvotes: 2

Views: 2379

Answers (2)

vsoni
vsoni

Reputation: 497

I was using Visual Composer 4.5.8 which is I think not compatible with wordpress 4.5.

To resolve an issue I have updated my visual composer to 4.11.2.1. I think latest one and now it works fine.

I've Referred to this link. Wordpress support link which describes about plugin issues

Upvotes: 1

marvinhagemeister
marvinhagemeister

Reputation: 3144

Your variable $template is undefined

var $template; // undefined
...
_.each($template.get(0)....) // $template is still undefined

Upvotes: 0

Related Questions