Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Discovered this after exporting a number of bundle fields to default config, and getting the following errors when accessing the
manage display tab for a custom entity.
Error: Call to a member function getBaseId() on null in /var/www/doris/web/modules/composer/videojs/src/Plugin/Field/FieldFormatter/VideoJsPlayerListFormatter.php on line 71
Error: Call to a member function getBaseId() on null in /var/www/doris/web/modules/composer/videojs/src/Plugin/Field/FieldFormatter/VideoJsPlayerFormatter.php on line 196
Sorry it's difficult to identify exactly what triggered it.
However, the code that throw's the error is dead and unused, and needs removal in any case.
Patch to follow.
Comment | File | Size | Author |
---|---|---|---|
#4 | videojs-isapplicable.patch | 1.94 KB | bradjones1 |
#2 | videojs-remove_dead_code_in_isavailable_methods-2799029-2-8.x-1.x-dev.patch | 1.76 KB | thursday_bw |
Comments
Comment #2
thursday_bw CreditAttribution: thursday_bw at Catalyst IT commentedHere is a simple patch to remove the dead code.
Comment #3
thursday_bw CreditAttribution: thursday_bw at Catalyst IT commentedComment #4
bradjones1Here's some cleanup as well - the if() is needlessly complicated. Plus some formatting fixes.
Comment #7
bradjones1"CI error"... hmm
Comment #8
Jeff Veit CreditAttribution: Jeff Veit commentedJust got it too. First edit after turning on videojs after site migrate.
And the patch #4 works for me.
Comment #9
swim CreditAttribution: swim commentedPatch #4 does the trick, thanks bradjones.
Comment #10
muckermarc CreditAttribution: muckermarc commentedI got a different error, when using the Entity Embed and File Entity Browser modules in conjunction with VideoJS.
The error appeared when editing embed buttons at /admin/config/content/embed or when trying to embed an image from the File Browser into a CKEditor text field.
Here's the error generated to help others who might be searching for this text:
The patch in #4 worked a treat - thanks!
Comment #11
fooway CreditAttribution: fooway commentedI also have this issue and the patch doesn't work.
-------------------------------------------------------------------
The website encountered an unexpected error. Please try again later.
Error: Call to a member function getBaseId() on null in Drupal\videojs\Plugin\Field\FieldFormatter\VideoJsPlayerListFormatter::isApplicable() (line 71 of modules/contrib/videojs/src/Plugin/Field/FieldFormatter/VideoJsPlayerListFormatter.php).
-------------------------------------------------------------------
Comment #12
_shYThis is already fixed - #2933497: VideoJsPlayerFormatter::isApplicable() needlessly loads entity form displays which can throw exceptions