Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure asset and page titles are correctly shown in ckeditor #13678

Open
wants to merge 3 commits into
base: 5.x
Choose a base branch
from
Open
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
6 changes: 2 additions & 4 deletions app/assets/libraries/ckeditor/src/TokenPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ export default class TokenPlugin extends Plugin {
tokens.map((item) => {
const itemId = item.id;
let tokenName = item.name;
let tokenNameArr = tokenName.split(':');
if (tokenNameArr[0] != undefined && tokenNameArr[0] === 'a')
{
tokenName = tokenNameArr[1];
if (tokenName.startsWith('a:')) {
tokenName = tokenName.substring(2);
}

if (itemId.match(/dwc=/i)){
Expand Down
11 changes: 7 additions & 4 deletions app/bundles/CoreBundle/Assets/js/11.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ Mautic.MentionLinks = function (editor) {

/*
* Customizes the way the list of user suggestions is displayed.
*
* @deprecated: will be removed in M6
*/
Mautic.customItemRenderer = function (item) {
let tokenId = item.id;
Expand All @@ -210,11 +212,9 @@ Mautic.customItemRenderer = function (item) {
const idElement = document.createElement( 'span' );
idElement.classList.add( 'custom-item-id' );
itemElement.classList.add( 'custom-item' );
const tokenNameArr = tokenName.split(':');

if (tokenNameArr[0] != undefined && tokenNameArr[0] === 'a')
{
tokenId = tokenName = tokenNameArr[1];
if (tokenName.startsWith('a:')) {
tokenName = tokenName.substring(2);
}

if (tokenId.match(/dwc=/i)){
Expand All @@ -230,6 +230,9 @@ Mautic.customItemRenderer = function (item) {
return itemElement;
}

/*
* @deprecated: will be removed in M6
*/
Mautic.getFeedItems = function (queryText) {
return new Promise( resolve => {
setTimeout( () => {
Expand Down