Dresden, Germany
Account created on 7 September 2021, about 3 years ago
#

Recent comments

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi @mrdrewkeller, can you please install the dev release and check if this fixes your issue?

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi @adinan cenci,

we have decided not to fix this issue. Please have a look at the drupal documentation about the issue status field

BR
Vincent

🇩🇪Germany vincent.hoehn Dresden, Germany

Thank you jverneaut. The patch is working like a charm. I was able to save the settings without errors, and the shortcodes are working as expected.

🇩🇪Germany vincent.hoehn Dresden, Germany

Another side effect was an incorrect config type in the schema.yml file.
This has been fixed in the new release and a patch is no longer necessary. Many thanks

🇩🇪Germany vincent.hoehn Dresden, Germany

We are using the shortcode module without the base tags, but we have a custom module that uses the shortcode API.

I am trying to implement the configuration scheme as follows:

filter_settings.shortcode_plugin:
  type: mapping
  label: 'Shortcode Plugin'
  mapping:
    shortcode_plugin:
      type: boolean
      label: 'Provides a shortcode plugin.'

It's not enough to implement the schema. We have to edit the plugin file (*Shortcode.php), because of the configuration section.

use Drupal\Core\Language\Language;
use Drupal\shortcode\Plugin\ShortcodeBase;

/**
 * The image shortcode.
 *
 * @Shortcode(
 *   id = "button",
 *   title = @Translation("Button"),
 *   description = @Translation("Insert a link formatted like a button.")
 * )
 */
class ButtonShortcode extends ShortcodeBase {
...
🇩🇪Germany vincent.hoehn Dresden, Germany

Sorry for the issue. The error also occurs without the ckeditor5_plugin_pack module.
If I install the module without the shortcode module, everything works fine. Thank you!

🇩🇪Germany vincent.hoehn Dresden, Germany

I get the same error, but only in combination with the CKEditor 5 Plugin Pack module.

🇩🇪Germany vincent.hoehn Dresden, Germany

Hello everyone. I hadn't thought of that, sorry!
I have published a new release. The 1.0.7 can now only be installed on Drupal >10.3 sites.

All others should stay on 1.0.5.

BR
Vincent

🇩🇪Germany vincent.hoehn Dresden, Germany

Hello guys. Thank you for confirming the fix. A new stable release is now available.

🇩🇪Germany vincent.hoehn Dresden, Germany

Hello again, I have resolved the issue, thank you for your help!

There is another issue 🐛 Replace LogicException with trigger_error in LangcodeRequiredIfTranslatableValues constraint RTBC in drupal core. It is not possible to save a text format. This patch needs to be applied.
I hope this problem will be fixed in core soon.

Can you please install the dev release, apply the patch and confirm that this resolves the issue?

🇩🇪Germany vincent.hoehn Dresden, Germany

I can confirm that the patch in #13 fixes the issue. I hope it will be included in core soon!

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi Ewout,

thanks for reporting the problem. I can reproduce the error. We will look into it and solve it as soon as possible.

BR
Vincent

🇩🇪Germany vincent.hoehn Dresden, Germany

vincent.hoehn made their first commit to this issue’s fork.

🇩🇪Germany vincent.hoehn Dresden, Germany

I think your issue is related to https://www.drupal.org/project/ckeditor5_template/issues/3378191 Possibility to specify a template file, so that it is not always overwritten during an update Fixed .
Drupal must be able to access the file, so it must be located under DRUPAL_ROOT.

You can place your template.json everywhere under DRUPAL_ROOT. Thereafter, you can configure the right file location under "text formats and editors".

🇩🇪Germany vincent.hoehn Dresden, Germany

I don't think we can implement it that easily.
With override=true, the source code would have to go through the content and find the template. But what if there are several identical templates in the document?

Moreover, the entire logic would have to be rebuilt, as the additional key in the JSON would have to become a recursive function. I don't know if it's worth the effort, I think manual deletion is the more suitable option.

🇩🇪Germany vincent.hoehn Dresden, Germany

Hello everyone. Do others in the community find this a helpful feature? Should we build it in?
BR, Vincent

🇩🇪Germany vincent.hoehn Dresden, Germany

Hello Jonathan,

Thank you very much for creating the issue and the effort for the patch.

The patch deletes the complete content of the editor before inserting a new template.
This is not a problem if the node is new and only one template is included, which is then “changed”.
However, this is disastrous if large and important content already exists. This is then removed.

For example, we use Drupal to create our manuals for our software. We use the template module to easily add recurring content such as notes, images, warnings, etc. Some text is several pages long, applying the patch and inserting a template would destroy the content.

BR
Vincent

🇩🇪Germany vincent.hoehn Dresden, Germany

Hello Maglor,

I cannot reproduce the error. The module works by default with the standard file ckeditor5_template.json.example.

The complete editor is broken. Do you see any errors in the console (accessible via F12)?

I suspect it is due to your template file or the content.

In addition, please note that you have various configuration options within the “Text formats and editors” section (see screenshot attached).

BR
Vincent

🇩🇪Germany vincent.hoehn Dresden, Germany

Hello everyone.
The aim of this module was to insert predefined content within the editor as easily as possible.
The easiest way was therefore to read a JSON file. I don't see the point of additionally storing the templates in a database.

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi everyone,

Thanks, @mnico, for reporting the issue and @dbielke1986 for the quick fix!

I accepted the merge request and ran webpack. I think we can publish a new release.

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi @nitin_lama,

Thanks for the prompt fix and the merge request!

Before I close the MR, I'm waiting for an opinion from other contributors regarding the package naming.

Best regards,
Vincent

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi @ravi kant,

I have just checked the other modules. All other modules have "CKEditor 5" as package definition, we have "CKEditor5".

So the correct definition would be "CKEditor 5" and not "CKEditor"?

Best regards,
Vincent

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi @mariacha1,

I could understand what you mean and where the problem lies.
But in my opinion, this is not a bug of the ckeditor5_template module.
I followed your instructions. I have included the module in Basic HTML, but not in Full HTML.
When I create an article, reduce the browser window and click in the edit field, the toolbar overlays the admin toolbar.
However, this also happens when I switch to a text format where the template module is not active.

In my opinion, this is due to CKEditor5 and/or the theme.

Best regards,
Vincent

🇩🇪Germany vincent.hoehn Dresden, Germany

We also have a problem with the z-index and the media-library-widget. It occurred after the update from 10.1.7 to 10.2.0.

🇩🇪Germany vincent.hoehn Dresden, Germany

We also have a problem with the z-index and the media-library-widget. However, it only occurred after the update from 10.1.7 to 10.2.0. Does anyone have the same issue?

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi @ressa,
yes, this is exactly how the module should work. Drupal must be able to access the file, so it must be located under DRUPAL_ROOT.

public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
    if (!file_exists(DRUPAL_ROOT . $form_state->getValue('file_path'))) {
      $form_state->setErrorByName('file_path', 'Template file not found.');
    }
  }

🇩🇪Germany vincent.hoehn Dresden, Germany

@ravi kant
At first, I wondered how you came to this view. Do you access your Drupal site with a smartphone or tablet?
You can't see a scrollbar because the CKEditor has no space to display it due to the small area.
Surely you can try to set a minimum height for the scrollbar (dropdownview) via CSS, but I don't know if that works.

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi @ravi kant. A part of the README looked a bit strange, so I made another change.
Thanks for adding the maintainers! Have a nice day!

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi @ravi kant. You can simply add as many templates as you like in the attached JSON file. For example:

[
    {
      "title": "Link",
      "icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.10 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z\"/></svg>",
      "description": "Insert a link to the CKEditor 5 Template plugin.",
      "html": "<p>Do you know the cool <a href='https://www.drupal.org/project/ckeditor5_template' target='_blank'>CKEditor 5 Template plugin</a>?</p>"
    },
{
      "title": "Link 2 ",
      "icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.10 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z\"/></svg>",
      "description": "Insert a link to the CKEditor 5 Template plugin.",
      "html": "<p>Do you know the cool <a href='https://www.drupal.org/project/ckeditor5_template' target='_blank'>CKEditor 5 Template plugin</a>?</p>"
    },
]
🇩🇪Germany vincent.hoehn Dresden, Germany

Hi @ressa, I can't reproduce this.
Each time the CKEditor is loaded, the stored configuration is loaded, in this case the "file_path". The file is then loaded.
If there are problems with the wrong content of the file or the wrong file itself, there can only be cache problems.
Normally, the changes should be applied after deleting the cache.

🇩🇪Germany vincent.hoehn Dresden, Germany

Thank you! Immediately implemented.

🇩🇪Germany vincent.hoehn Dresden, Germany

Sorry, @ressa. Now ALL errors/typos should really be fixed 😁

🇩🇪Germany vincent.hoehn Dresden, Germany

Hello @ressa and @dbielke1986, I have merged the MR. Many thanks for the support!
The line breaks in the “icon” were intentionally there. The aim was to give users a better understanding of how it works and should be used. So we worked with line breaks for the icon.

In addition, the project description has been changed and is now up-to-date. :)

🇩🇪Germany vincent.hoehn Dresden, Germany

With 1.0.4 everything should work as it is supposed to!

🇩🇪Germany vincent.hoehn Dresden, Germany

I have just published a new stable release. With 1.0.4 everything should work as it should. Thank you!

🇩🇪Germany vincent.hoehn Dresden, Germany

Sorry guys..
Can you please install the dev-Release and check if this solve the issue?
composer require 'drupal/ckeditor5_template:1.0.x-dev@dev'

🇩🇪Germany vincent.hoehn Dresden, Germany

Integrated in Release 1.0.3

🇩🇪Germany vincent.hoehn Dresden, Germany

Integrated in Release 1.0.3.

🇩🇪Germany vincent.hoehn Dresden, Germany

The implementation is complete. I have merged the issue-fork in our dev branch 1.0.x-dev. If everything works, we will publish a new release soon.

🇩🇪Germany vincent.hoehn Dresden, Germany

Thank you for your feature request! The implementation has started.

🇩🇪Germany vincent.hoehn Dresden, Germany

vincent.hoehn made their first commit to this issue’s fork.

🇩🇪Germany vincent.hoehn Dresden, Germany

Thanks for reporting the bug! Unfortunately I don't see a way to support templates with the same title right now. Following our logic, we take the title and search in our templates for matches. We do not use a key.

I have modified the README, do these changes suit for you?
BR, Vincent

🇩🇪Germany vincent.hoehn Dresden, Germany

Thank you! Works great!

🇩🇪Germany vincent.hoehn Dresden, Germany

Thank you for this patch. With the CKEditor5 it works well. I hope this gets merged quickly.

🇩🇪Germany vincent.hoehn Dresden, Germany

vincent.hoehn made their first commit to this issue’s fork.

🇩🇪Germany vincent.hoehn Dresden, Germany

Sorry for the confusion. I was mistaken, we use the node_edit_protection module.

It is a simple but very useful module. I would appreciate it if the CKEditor had this functionality by default. That's why I'm changing the category to feature request.

Thank you very much!

🇩🇪Germany vincent.hoehn Dresden, Germany

Thank you very much! Works great.

🇩🇪Germany vincent.hoehn Dresden, Germany

Thank you for the fix, works great!

🇩🇪Germany vincent.hoehn Dresden, Germany

Thank you, Daniel! I was also able to reproduce it on a fresh install with these steps.

🇩🇪Germany vincent.hoehn Dresden, Germany

The patch is working great and resolved our problem! Next, we try to reproduce this issue on a fresh D9 install.

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi caesius,

We have uninstalled all custom modules and also our custom theme. The problem still occurred.

Then we used the hard copy from your patch.

$form['actions']['save_edit'] = unserialize(serialize($form['actions']['submit']));

We also added several loggers to look at the form array in the different states. Then we noticed the following log of the save_edit array:

Array
(
    [#type] => submit
    [#value] => Save & Edit
    [#submit] => Array
        (
            [0] => ::submitForm
            [1] => save_edit_form_submit_presave
            [2] => ::save
            [3] => save_edit_form_submit_redirect
            [4] => Array
                (
                    [0] => Drupal\content_moderation\EntityTypeInfo
                    [1] => bundleFormRedirect
                )

        )

    [#access] => 1
    [#weight] => 5
    [#name] => save_edit
)

In [4], the content moderation module makes a redirect. Maybe you don't have this module installed and therefore couldn't adjust it?

If we delete the [4] out of the array, the module works as it should!

unset($form['actions']['save_edit']['#submit'][4]);

Hope this is helpful!

🇩🇪Germany vincent.hoehn Dresden, Germany

We have tried several ways. We have applied and reapplied all patches between the last bugs and releases. Maybe it really is an issue with the deep copy.

Thanks for the patch! Unfortunately, it does not solve my problem.

All custom modules have been removed, and the theme were checked, the bug persists.

We will test it again on a fresh installation.

Thank you for your time and the fast answer!

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi caesius,

our system is running on 9.5.10. I have downgraded from 1.5 to 1.4. With version 1.3 the module works as expected. I think there is a bug in the function save_edit_form_alter. If I replace the code:

if (in_array($content_type, array_values($enabled_node_types), TRUE)) {
      // Let save_edit button inherit all actions from submit action.
      $form['actions']['save_edit'] = $form['actions']['submit'];
      if (isset($form['actions']['submit']['#attributes']) && is_object($form['actions']['submit']['#attributes'])) {
        $form['actions']['save_edit']['#attributes'] = clone $form['actions']['submit']['#attributes'];
      }
      $form['actions']['save_edit']['#value'] = $config->get('button_value');
      $form['actions']['save_edit']['#name'] = 'save_edit';
      foreach ($form['actions']['save_edit']['#submit'] as $key => $action) {
        if ($action == "::submitForm") {
          array_splice($form['actions']['save_edit']['#submit'], $key + 1, 0, ['save_edit_form_submit_presave']);
        }
      }
      foreach ($form['actions']['save_edit']['#submit'] as $key => $action) {
        if ($action == "::save") {
          array_splice($form['actions']['save_edit']['#submit'], $key + 1, 0, ['save_edit_form_submit_redirect']);
        }
      }
      $form['actions']['save_edit']['#weight'] = $config->get('button_weight');

with the source code from 1.3

if (in_array($content_type, array_values($enabled_node_types), TRUE)) {
      $form['actions']['save_edit'] = [
        '#type' => 'submit',
        '#value' => $config->get('button_value'),
        '#name' => 'save_edit',
        '#submit' => [
          '::submitForm',
          'save_edit_form_submit_presave',
          '::save',
          'save_edit_form_submit_redirect',
        ],
        '#weight' => $config->get('button_weight'),
      ];

Everything is working correctly. I also checked our custom code..

🇩🇪Germany vincent.hoehn Dresden, Germany

I'm fine with the merge request @kevinfunk. I hope this get merge quickly.

🇩🇪Germany vincent.hoehn Dresden, Germany

So far, all errors and warnings have been fixed. The output of the command now looks like this:

FILE: /var/www/html/docport/web/modules/contrib/ckeditor5_template/js/ckeditor5_plugins/template/src/template.js
----------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------
 20 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 22 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 36 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 60 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 61 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/docport/web/modules/contrib/ckeditor5_template/js/template.js
---------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------
 1 | WARNING | File appears to be minified and cannot be processed
---------------------------------------------------------------------------------


FILE: /var/www/html/docport/web/modules/contrib/ckeditor5_template/webpack.config.js
---------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------
 20 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 25 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 29 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------

Time: 256ms; Memory: 10MB

The coding standards refer mostly to the extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
js files are not included. If the "errors" were fixed with the instructions, the module would not work. The build process does not work at all.

So I think we have solved that.

🇩🇪Germany vincent.hoehn Dresden, Germany

What is the recommended way now? I have made the most commits on the project, should I create a new issue?

🇩🇪Germany vincent.hoehn Dresden, Germany

Thank you very much, dagmar. I have implemented the functionality. This allowed us to reduce the size of the template.js to 2.06KB! Can you take a look at the branch 1.0.x-feature/3378579?

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi @dagmar, thank you for your feature request!

The size of the file is huge, unfortunately. We were faced with the problem of how to make icons available to users. Through the build process, the icons are included in the file. So if a user wanted to use their icons, they would have to rebuild the file. We didn't want to do that.
Then we came up with the idea of including an icon set. This way, the choice for each user is huge. The advantage of the choice of icons won out over the disadvantage of the file size.

You are right about the license. GPL v2 is not fully compatible with the Apache 2 license!

What would you prefer for a solution? A different icon set with a different/compatible license and fewer icons?

🇩🇪Germany vincent.hoehn Dresden, Germany

Hi Dan,

Thanks a lot! I am happy that the module is being used!

The location of the file is not the best, I know. Previously, the file was located in the home directory. But since a path is defined in the compiled build file, I had to make sure that the folder exists for everyone. So I took the file into the module directory.

We use the following way:
Install the module via composer
Create and apply a patch (or another way to modify the file)
When updating, composer tells you that there are changes and how to handle them (options y,n,v,d,s). We used s and the changes were still there.

All options:

y - discard changes and apply the update
n - abort the update and let you manually clean things up
v - view modified files
d - view local modifications (diff)
s - stash changes and try to reapply them after the update

This has the same effect as your way, right? Or can you tell me a bit more about it?

I also tried to develop an own configuration site, where you can configure the path to the configuration file. But I dont know how to do it yet.

BR Vincent

🇩🇪Germany vincent.hoehn Dresden, Germany

Hello all. I have just looked at the MR and tested it on our system. It works and everything looks good! Thanks!

🇩🇪Germany vincent.hoehn Dresden, Germany

We can confirm that the patch works with 2.1. Thanks!

🇩🇪Germany vincent.hoehn Dresden, Germany

The patch works great, okay for merge. That's why I'm changing the status to RTBC!

🇩🇪Germany vincent.hoehn Dresden, Germany

The patch works for me! Do we have a chance for a new release?

🇩🇪Germany vincent.hoehn Dresden, Germany

Hello folks. We used this module and needed the functionality urgently for CKEditor5 and Drupal 10, so we developed a plugin and module. For all of you who use the functionality, check out ckeditor5_template , maybe it's helpful for someone!

🇩🇪Germany vincent.hoehn Dresden, Germany

I can confirm this, thank you, Leander! With your steps, I was able to get anchor_link to work successfully in CKEditor5.

🇩🇪Germany vincent.hoehn Dresden, Germany

For me, the new version 2.x does not work. Previously, too many revisions were deleted. But now too few revisions are deleted. At least that's how it looks.
In the sandbox, the module works great at first sight. But in our system with two languages and 40k revisions, it doesn't seem to work. Too bad!

Production build 0.71.5 2024