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

Commit

Permalink
EZP-28785: Unable to publish draft after changing its translation (#980)
Browse files Browse the repository at this point in the history
* Disabled changing languages after saving a Draft of the new content item.

* Changed variable name from isChangingLanguageAllowed to isTranslationAllowed
  • Loading branch information
mateuszbieniek authored and andrerom committed Sep 24, 2018
1 parent d36d982 commit fc7f1fe
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -140,14 +140,16 @@ YUI.add('ez-contentcreateviewservice', function (Y) {
* @param {EventFacade} e
*/
_selectLanguage: function (e) {
var isTranslationAllowed = this.get('content').isNew();

e.preventDefault();
this.fire('languageSelect', {
config: {
title: Y.eZ.trans('change.language.to', {}, 'contentedit'),
languageSelectedHandler: Y.bind(this._setLanguage, this, e.target, e.fields),
cancelLanguageSelectionHandler: null,
canBaseTranslation: false,
translationMode: true,
translationMode: isTranslationAllowed,
referenceLanguageList: [this.get('languageCode')]
},
});
Original file line number Diff line number Diff line change
@@ -333,6 +333,11 @@ YUI.add('ez-contentcreateviewservice-tests', function (Y) {
this.request = {params: {languageCode: this.languageCode}};
this.capi = {};

Mock.expect(this.content, {
method: 'isNew',
returns: true
});

Mock.expect(this.version, {
method: 'get',
args: ['versionId'],

0 comments on commit fc7f1fe

Please # to comment.