Problem/Motivation

Saving empty converter options for the header and/or footer (admin/config/ckeditor5-premium-features/export-word) will lead to these warnings:

Warning: Undefined array key "header" in Drupal\ckeditor5_premium_features_export_word\Plugin\CKEditor5Plugin\ExportWord->convertConfigOptionsFormatToV2() (line 180 of modules/contrib/ckeditor5_premium_features/modules/ckeditor5_premium_features_export_word/src/Plugin/CKEditor5Plugin/ExportWord.php).
Warning: Undefined array key "footer" in Drupal\ckeditor5_premium_features_export_word\Plugin\CKEditor5Plugin\ExportWord->convertConfigOptionsFormatToV2() (line 183 of modules/contrib/ckeditor5_premium_features/modules/ckeditor5_premium_features_export_word/src/Plugin/CKEditor5Plugin/ExportWord.php).

Steps to reproduce

1. Add export to word plugin in your format settings.
2. Save export settings here - admin/config/ckeditor5-premium-features/export-word with empty header and/or footer configurations.
3. Go to the content creation/edit form where the format from step 1 is used and see the warnings.

Proposed resolution

Fix the issue in the code by adjusting the check for header/footer configurations, like adding isset check

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

quadrexdev created an issue. See original summary.

quadrexdev’s picture

Status: Active » Needs review

I have added a fix in the merge request -> https://git.drupalcode.org/project/ckeditor5_premium_features/-/merge_re...

Please review

salmonek made their first commit to this issue’s fork.

salmonek changed the visibility of the branch 1.4.x to hidden.

salmonek’s picture

Status: Needs review » Reviewed & tested by the community

Hi Yaroslav
Thank you for contribution. I created a branch mergeable to 1.4.x and cherry picked your commit. It'll be published in 1.4.1

salmonek’s picture

Title: Warning: Undefined array keys header/footer in Drupal\ckeditor5_premium_features_export_word\Plugin\CKEditor5Plugin\ExportWord->convertConfigOptionsFormatToV2() » Warning: Undefined array keys header/footer in export to Word
salmonek’s picture

Fix has been released in 1.4.1

salmonek’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.