PHP 8+ compatibility: Fix "Undefined array key 'editor_object'" error in TooltipEditorDialog

Created on 8 August 2025, about 1 month ago

Problem/Motivation

When using the ckeditor_tippy module with PHP 8+, users encounter warnings when opening the tooltip dialog:

Warning: Undefined array key "editor_object" in /path/to/web/modules/contrib/ckeditor_tippy/src/Form/TooltipEditorDialog.php on line 42
Warning: Trying to access array offset on value of type null in /path/to/web/modules/contrib/ckeditor_tippy/src/Form/TooltipEditorDialog.php on line 42

This results in AJAX errors and prevents the tooltip dialog from working properly.

Steps to reproduce

  1. Install ckeditor_tippy module version 1.0.12
  2. Use PHP 8.0 or higher
  3. Try to add a tooltip using the CKEditor toolbar button
  4. Observe the PHP warnings and AJAX error

Proposed resolution

Add proper isset() checks before accessing array keys in the TooltipEditorDialog.php file. The code currently tries to access $user_input['editor_object']['text'] without verifying that the 'editor_object' key exists.

Remaining tasks

  • Review and test the proposed patch
  • Commit the fix to the module

User interface changes

None - this is a bug fix that maintains existing functionality while eliminating PHP warnings.

API changes

None

Data model changes

None

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024