Skip to content

Commit

Permalink
can't save resolveuid link if protocol is not other
Browse files Browse the repository at this point in the history
  • Loading branch information
gotcha committed Dec 14, 2023
1 parent 94a7948 commit 689b840
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/collective/ckeditor/browser/statics/ckeditor_plone.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,20 @@ CKEDITOR.on( 'dialogDefinition', function( ev ) {
showActualUrl(domElement, url);
default_onKeyUp.apply(this);
};

var default_validate = url.validate;
url.validate = function() {
if ( this.getValue().includes('resolveuid') ) {
var dialog = this.getDialog();
var protocol = dialog.getValueOf('info', 'protocol');
console.log("protocol: " + protocol);
if ( protocol != '') {
alert( 'When using internal link that contains resolveuid, protocol needs to be <other>.' );
return false;
}
}
return default_validate.apply(this);
};
}

// Check if the definition is from the dialog we're
Expand Down

0 comments on commit 689b840

Please sign in to comment.