widget on modelchange epi version 10 vs epi version 11.

Vote:
 

Hi,

We are seeing some different behaviours in epi version 11.x

On 9 and 10 we used:

topic.subscribe("siteattention/modelchanged", lang.hitch(this, "_onModelChanged"));

which works fine, but it is not getting called on first load in Epi11.

Any guidance?

UPDATE:

Get this in the console log as well (not sure how to change it):

widgets.js:2 OBSOLETE: epi/shell/_StatefulGetterSetterMixin Use dojo/Stateful custom setters/getters instead
#193806
Edited, Jun 05, 2018 13:37
Vote:
 

That code snippet subscribes to an event that you publish in your SiteAttention add-on. You will need to look into your code to see when that event should be published. This might help you discover why it is no longer doing so. Otherwise you will need to share the code so we can see in what context it is being called and maybe then we can help you.

#193941
Jun 08, 2018 8:51
Vote:
 

In the postcreate function we are subscribing and posting.

In Episerver version 9 and 10, this triggers correct modelchange on first click (IE when you change a page) but in Episerver 11.x it does not trigger until second click of that link. So my question is what have changed?

And the below warning i also added, but cannot find any documentation for.

Thanks

#193953
Jun 08, 2018 12:53
Vote:
 

These are the breaking changes done in CMS 11 https://world.episerver.com/documentation/upgrading/Episerver-CMS/cms-11/breaking-changes-cms-11/

The obsolete warnings should not cause any issue. They are meant to alert developers to something that will be removed in a future version, and recommend an alternative. If you have any usages of epi/shell/_StatefulGetterSetterMixin then you should consider refactoring these.

Otherwises, without some sort of source code to look at, I am unable to help you.

#193958
Jun 08, 2018 13:58
Vote:
 

Hi Ben,

I have seen those changes but they do not describe what has changed since first reload is not working anymore. Looking at it Epi has since version 9 been using Dojo 1.8.9 so it does not explain why the change in behaviour. And the breaking changes does not sugges any solutions.

The 'epi/shell/_StatefulGetterSetterMixin' were are not using in our code, which makes even more mysterical.

The specific used for the first issue:

postCreate: function () {
           ...

            if (!EPiServerSiteAttentionData.OnModelChangeSubscribed) {
                topic.subscribe("siteattention/modelchanged", lang.hitch(this, "_onModelChanged"));
                EPiServerSiteAttentionData.OnModelChangeSubscribed = true;
            }

            when(this.getCurrentContent(), function (contentData) {
                topic.publish("siteattention/modelchanged", { contentData: contentData });
            });
        },
...

And the function that is never called on first click in Episerver 11 which works in 9 and 10:

_onModelChanged: function (model) {
            SiteAttentionEpiServerWatcher.updateBaseModel(model);
...
    });
#193962
Jun 08, 2018 14:17
Vote:
 

From what I can tell, those code snippets should still work the same in CMS 11. We haven't changed anything in the getCurrentContent method. I'm afraid that I can't be of much help.

I would recommend contacting our support team and creating a support case.

#193986
Jun 11, 2018 8:04
Vote:
 

I'm seeing the same obsolete warnings after upgrading to Episerver 11, also have no references in our own code. If a fix or explanation should appear, please share :)

#194399
Jun 20, 2018 13:12
Vote:
 

We obsoleted _StatefulGetterSetterMixin after releasing CMS 11. Unfortunetly we have one usage within CMS UI that can't be removed without causing a breaking change. This is what will be causing the warning.

#194403
Jun 20, 2018 14:25
Vote:
 

Ah I see. Thanks for the info!

#194404
Jun 20, 2018 14:27
Vote:
 

Hi Ben,

Thank you.

We also see the following when debugging (Chrome console) which is not coming from our side:

1: ComponentController::loadComponents
widgets.js:2 1: 574.753173828125ms
widgets.js:2 
2: FormContainer::_setupUI undefined
widgets.js:2 2: 68.19189453125ms
widgets.js:2 
3: FormContainer::_setupUI undefined
widgets.js:2 3: 486.254150390625ms
widgets.js:2 
4: FormContainer::_setupUI undefined
widgets.js:2 4: 44.705810546875ms
widgets.js:2 
5: FormContainer::_setupUI undefined
widgets.js:2 5: 41.720947265625ms
#194405
Jun 20, 2018 14:30
Vote:
 

Does anyone know the solution to the errors above? we're getting the same ones in the console after upgrading to v11.6 and trying to load a custom Dojo-widget.

#200434
Jan 11, 2019 16:41
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.