jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

VideoPress_Divi_Extension does not have a method "admin_hook_enqueue_scripts"

Open aisajib opened this issue 1 year ago • 4 comments

Impacted plugin

Jetpack, VideoPress

Quick summary

The issue was reported as many as twice with older versions of Divi (4.2.2), where the following Fatal Error shows up when the VideoPress module is active.

Steps to reproduce

  1. Install Divi 4.2.2.
  2. Have Jetpack's VideoPress module active.
  3. Navigate to wp-admin

A clear and concise description of what you expected to happen.

WP-Admin should work as expected.

What actually happened

A critical error is displayed. CLI shows the following error:

PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class VideoPress_Divi_Extension does not have a method "admin_hook_enqueue_scripts"

Impact

Some (< 50%)

Available workarounds?

Yes, easy to implement

If the above answer is "Yes...", outline the workaround.

No response

Platform (Simple and/or Atomic)

Atomic

Logs or notes

The latest version of Divi appears to have been updated, so the error is less widespread. However, I'm still opening an issue after the Slack conversation here: p1725819820858299-slack-C03TY6J1A

Notes from Mike on that Slack thread:

=== VideoPress_Divi_Extension is part of Jetpack to add VideoPress support in Divi. This exists in Jetpack in jetpack/13.8/jetpack_vendor/automattic/jetpack-videopress/src/videopress-divi/class-videopress-divi-extension.php. It seems to not be compatible with PHP 8+ as there is no function defined for admin_hook_enqueue_scripts , which is called during initialization. PHP 8+ is more strict about this.

Divi added admin_hook_enqueue_scripts to their DiviExtension class at some point in the last 4 years, which is what Jetpack extends. Jetpack should still have this function defined as well to prevent the fatal in older versions of Divi, so it's still worth filing a bug report. In newer versions of Divi it is defined as this:

public function admin_hook_enqueue_scripts() {
    if ( et_builder_bfb_enabled() || et_builder_is_tb_admin_screen() ) {
        $this->_enqueue_backend_styles();
    }
}

===

The two user-reported errors were here and 8707111-zd-a8c.

aisajib avatar Sep 10 '24 05:09 aisajib

Support References

This comment is automatically generated. Please do not edit it.

  • [ ] https://wordpress.com/forums/topic/divi-wordpress-com-business
  • [ ] 8707111-zen
  • [ ] 9172850-zen

github-actions[bot] avatar Sep 10 '24 05:09 github-actions[bot]

cc @pgk ; Is that something you could look into, since you had worked on the original functionality in #28193?

Thank you!

jeherve avatar Sep 10 '24 09:09 jeherve

Came across another instance of this error in 9172850-zd-a8c (Divi version 4.4.1). Updating to the latest version of Divi (currently 4.27.4) fixed the issue.

jp-imagines avatar Dec 13 '24 16:12 jp-imagines

This issue has been marked as stale. This happened because:

  • It has been inactive for the past 6 months.
  • It hasn’t been labeled `[Pri] BLOCKER`, `[Pri] High`, `[Type] Feature Request`, `[Type] Enhancement`, `[Type] Janitorial`, `Good For Community`, `[Type] Good First Bug`, etc.

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

github-actions[bot] avatar Jun 23 '25 00:06 github-actions[bot]