Account created on 2 November 2011, over 13 years ago
#

Merge Requests

Recent comments

🇳🇿New Zealand klidifia

Reroll for 7.x where linkit.libraries.yml does not apply but also: This hardcoded limit of 1 is changed in linkit.autocomplete.js but there is also the plugin for CKEditor with this limit that should change.

🇳🇿New Zealand klidifia

I tested this using a new draft of a page on the /node/x/latest route as well as /node/x/revisions/x/view and the menu blocks show up on both.

Good stuff.

🇳🇿New Zealand klidifia

I tested the updated patch with the scenario outlined and confirm no warnings/errors and instead a 404 now -- looks good.

The code looks good and the comment explains nicely. Good stuff!

🇳🇿New Zealand klidifia

Tests pass and code change correct

🇳🇿New Zealand klidifia

Have put both replacements in the same line, I can utilise both tokens OK.

🇳🇿New Zealand klidifia

The added lines are overwriting the variable declared in the previous line, so whilst this lets [name] be used, it means [id] cannot be used.

Lets see if we can make them both work.

🇳🇿New Zealand klidifia

Thanks both -- Yeah I can replicate that with installing Editor Advanced Module.

I note the code block on both modules is basically the same around the _addExtraAttributeOnLinkCommandExecute

Both have same priority high, if I change editoradvancedlink to highest, then it works OK. I'm not sure yet of the best way to make them play nice together and if there are other issues with both modules in play.

🇳🇿New Zealand klidifia

@nick-hope thanks for trying it. I can't see what might be happening, I imagine it is producing some sort of JS error in console when not closing the Link window. I tried the same on a Fresh D10 install. Configured the default Linkit matcher to include taxonomy terms, made a term (Thailand) and tested on a new page in a few separate places. (Type 'Thai', select via Linkit, enters Link URL as /taxonomy/term/1, click green tick, entered as Thailand.)

<p>
    <a href="/taxonomy/term/1" data-entity-type="taxonomy_term" data-entity-uuid="c2415acd-08e0-494d-b51d-09acc1728f0d" data-entity-substitution="canonical" data-entity-title="Thailand">Thailand</a>
</p>
🇳🇿New Zealand klidifia

I updated this issue with some code that will use the entity title (already obtained via Linkit) as the default link text for a brand new inserted link without a selection range: Display node title (a text) in by default when creating link in ckeditor5 Closed: duplicate

🇳🇿New Zealand klidifia

Previous approaches no longer work. I updated this issue with some code that will use the entity title (already obtained via Linkit) as the default link text for a brand new inserted link without a selection range: Display node title (a text) in by default when creating link in ckeditor5 Closed: duplicate

🇳🇿New Zealand klidifia

I updated this issue with some code that will use the entity title (already obtained via Linkit) as the default link text for a brand new inserted link without a selection range: Display node title (a text) in by default when creating link in ckeditor5 Closed: duplicate

🇳🇿New Zealand klidifia

I updated this issue with some code that will use the entity title (already obtained via Linkit) as the default link text for a brand new inserted link without a selection range: Display node title (a text) in by default when creating link in ckeditor5 Closed: duplicate

🇳🇿New Zealand klidifia

I updated this issue with some code that will use the entity title (already obtained via Linkit) as the default link text for a brand new inserted link without a selection range: Display node title (a text) in by default when creating link in ckeditor5 Closed: duplicate

🇳🇿New Zealand klidifia

With D10/CKEditor5: I needed the existing functionality that this was achieving, but I decided to use Linkit module as it seemed to be the easiest to use to do this: Display node title (a text) in by default when creating link in ckeditor5 Closed: duplicate

🇳🇿New Zealand klidifia

I needed to solve this so have altered JS so when creating a new (internal) link in CKEditor5 using the Link function and locating the entity using LinkIt - the URL alias is inserted as the default link text.

There are a lot of other issues in Linkit around this or related to this:

Display node title by default when creating link with drupalink, allow configuration. Needs work (Core) - This is where a solution had been made until Drupal 10 / CKEditor5
Show URL alias after autocomplete selection instead of internal route (e.g., /node/123) Needs work
Show entity title after autocomplete selection instead of internal route (e.g., /node/123) Needs work
#3014297: Use target name as anchor text
Insert node title instead of # when no link text is selected Closed: works as designed
Allow customization of default text when text not selected Closed: outdated

🇳🇿New Zealand klidifia

@ericgsmith thank you and yes I tested the suggested changes and it works - updated the PR with it.

🇳🇿New Zealand klidifia

I don't think that commit includes the patch for this issue.

🇳🇿New Zealand klidifia

Effectively the same as #3 - rerolled so can apply against the latest (nov 23) 1.4 version.

🇳🇿New Zealand klidifia

In regards to points 1 and 3 from 115 -- used appropriate permission: "insert ckeditor permission" and the parameters.

Replaced the various inconsistent double quotes with singles.

🇳🇿New Zealand klidifia

ericgsmith & s_leu yes. thank you! (108/109) - the pre-existing config was the issue and the schema patch in 109 helped resolve it.

I encountered a separate issue due to the wrapping around the inserted template with the section and div wrapper (my issue was that the section markup produces another insertbefore arrow in ckeditor) - I am thinking that this wrapper is not needed and hence if so some of the code can be removed, I include a patch with the intent.

🇳🇿New Zealand klidifia

The changes in #91 converting the code field are not working for me.

The following error is produced:

`Cannot assign string to property Drupal\\ckeditor_templates\\Entity\\CKEditorTemplates::$code of type array in Drupal\\Core\\Entity\\EntityBase->__construct() (line 63 of core/lib/Drupal/Core/Entity/EntityBase.php).`

In this patch that change is undone and it now aligns with the MR. N.B. there are some other diffs between these patches and the MR such as README.md/txt

🇳🇿New Zealand klidifia

This is specifically about what the default link text is when a link is inserted via the plugin button into CKE so I don't think this is a duplicate of 2966320 ((ref comment #3 paragraph 2 (Issue 2961554)).

That issue no longer applies in D10 because the Drupal form used as an intermediary between Drupal/CKEditor no longer exists.

I am not sure the issue outlined here can be solved within Linkit now -- I don't know how this can be achieved.

🇳🇿New Zealand klidifia

Outer wrapper :) I changed to just wrapper - and took out other misc changes

🇳🇿New Zealand klidifia

Have:

  • Added outer wrapper div with text-align: right
  • Removed float and bottom margin from the button
🇳🇿New Zealand klidifia

Hi I am not sure where the issue is and it might be in 3396493 but I was testing this change and note that once I save the page and then re-edit it; the editor doesn't seem to recognise the anchor links, e.g. when I click within them, there is no longer the pop-up dialog to edit/remove the anchor link.

🇳🇿New Zealand klidifia

I'm not sure reducing the width to 52rem is right, on a wide screen it makes it quite narrow? I wanted to add that I was testing this issue but using the patch in 3381219 which seemed to work well for me. And it looks like these two will conflict.

🇳🇿New Zealand klidifia

I think the issue here is not confined to a browser and is in essence this:

If the width of the Claro theme is extended via some method there are undesirable results.

An easy way to test this is to input a long string into the new CKEditor5 interface, e.g. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiioooooooooooAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiioooooooooooA - Observe the undesirable effects.

I think this patch resolves the issue experienced here, and is likely solving various disparate issues e.g. 3372054

Please could someone else test/verify.

🇳🇿New Zealand klidifia

Please check issue 3381219 - it may be related and could solve this.

🇳🇿New Zealand klidifia

I am experiencing something and wondering if related:

Could someone please attempt to replicate this:
- Create a page with body "test"
- Highlight that text and use the anchor link button and give that an anchor name of "test"
- Save page
- Re-edit page

Markup is:

<p>
    <a class="ck-anchor" id="test">test</a>
</p>

- Position cursor at the end of the word "test" and note that an extra anchor link appears at the end
- Position cursor at the start of the word "test" and note that an extra anchor link appears at the start

- Highlight the word "test" and click the Unanchor button
- Position the cursor anywhere within or around the word "test" and notice that an anchor appears

Viewing the source after this, we have an anchor without an ID, which we cannot get rid of:

<p>
    <a class="ck-anchor">test</a>
</p>
🇳🇿New Zealand klidifia

What is the markup it leaves for it? I noticed that my existing tabs have a different format e.g. the tab-link class is on the li rather than a element, and, the tab-pane div does not contain a child <div class="tab-pane-content"> - so now loading that through CKEditor just doesn't work as it strips the markup down -- I need to re-format those seemingly.

🇳🇿New Zealand klidifia

Confirmed behavior. The (combined) patch applied fixes it so newly added tabs have the default content: (note now says "Tab x Content" and before has Tab x Contents"

🇳🇿New Zealand klidifia

Thank you both. The change with patch #5 now makes the CKEditor functionality work properly with the tabs and the li items together.

🇳🇿New Zealand klidifia

core_version_requirement: ^8.9 || ^9 || ^10

🇳🇿New Zealand klidifia

Thank you. Acknowledged. Will use your exemplary "Reviewed the code and it seems fine. I see ini_get used in core code and didn't see a helper method for this variable." as a benchmark going forward.

🇳🇿New Zealand klidifia

Unsure how to introduce path_alias into the test setup for this as TokenFieldUiTest extends TokenTestBase

🇳🇿New Zealand klidifia

If the token resolves to an internal URL (e.g. an internal node selected from an autocomplete lookup), this won't render as a link.

Have taken the 24.patch on GitLab and added:

if (strpos($uri, '/') === 0) {
  $uri = 'internal:' . $uri;
}

Before the:

$replacements[$original] = Markup::create($uri);
🇳🇿New Zealand klidifia

Any info regarding the issues in 9.5.1 / 10? Have only tested in 9.4.10 just now -- I applied #215 and it works, however:

I am not sure why there is an access check for the user having edit permissions for the node in question. The permission controlling this functionality should be solely the transition permissions within Content Moderation, like it is with the Content Moderation form that appears on a node (the user does not need edit permissions in order to use that form and transition the node using that form).

🇳🇿New Zealand klidifia

Only appends extensions if set -- good.

🇳🇿New Zealand klidifia

The static caching and returning of the $view_title variable results in HTML entities not being decoded - altering to solve.

🇳🇿New Zealand klidifia

Because CKEditor is moved to Contrib now I believe.

Have patched the same JS files here in new issue: https://www.drupal.org/project/ckeditor/issues/3340081 Display node title by default when creating link with drupalink Needs review

🇳🇿New Zealand klidifia

#26 Suddenly stopped working I guess with some Core updates - will try to figure out why

Production build 0.71.5 2024