Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Fix EZP-26657: Deprecation log in the console when viewing a Content #737

Merged
merged 1 commit into from
Nov 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,16 @@ YUI.add('ez-locationviewrelationstabview', function (Y) {
*/
_fireLoadObjectRelations: function () {
/**
* Fired when object relations are going to be loaded
* Fired to load the object relations
*
* @event loadObjectRelations
* @param {Bool} loadLocationPath flag indicating whether the locations' paths should be loaded
* @param {Boolean} loadLocationPath flag indicating whether the locations' paths should be loaded
* @param {eZ.Content} content
*/
this.fire('loadObjectRelations', {loadLocationPath: true});
this.fire('loadObjectRelations', {
loadLocationPath: true,
content: this.get('content'),
});
},
}, {
ATTRS: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ YUI.add('ez-locationviewrelationstabview-tests', function (Y) {
fireLoadObjectRelationsEventTest = new Y.Test.Case({
name: "eZ LocationViewRelationsTabView fire load object relations event test",
setUp: function () {
this.view = new Y.eZ.LocationViewRelationsTabView({});
this.content = {};
this.view = new Y.eZ.LocationViewRelationsTabView({
content: this.content,
});
},

tearDown: function () {
Expand All @@ -270,6 +273,21 @@ YUI.add('ez-locationviewrelationstabview-tests', function (Y) {

Assert.isTrue(relationsCalled, "loadObjectRelations should have been called");
},

"Should fire the loadObjectRelations with parameters": function () {
this.view.once('loadObjectRelations', Y.bind(function (e) {
Assert.isTrue(
e.loadLocationPath,
"The `loadLocationPath` parameter should be set to true"
);
Assert.areSame(
this.content, e.content,
"The content item should be provided in the event facade"
);
}, this));

this.view.set('active', true);
},
});

Y.Test.Runner.setName("eZ Location View Relations Tab View tests");
Expand Down