Video Embed Field Plyr - PHP exception upon 1st save

Created on 17 May 2023, about 1 year ago

Problem/Motivation

PHP Uncaught PHP Exception

Drupal\Core\Config\UnsupportedDataTypeConfigException:

Invalid data type for config element: settings.youtube.noCookie

Steps to reproduce

0) added a video embed field to a content type
1) in format display tab, change output type from default video player to the plyr display format type
2) attempt access settings, or attempt to click the save settings button at the lower left (see screenshot)
3) the PHP crash above is the result.

Proposed resolution

Not an expert.
This might be a PHP 8.0 compatibility problem since this module worked correctly with a different Drupal site running a prior release of PHP.

Remaining tasks

- unknown -

User interface changes

- unknown -

API changes

- unknown -

Data model changes

- unknown -

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States websiteworkspace

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

Comments & Activities

  • Issue created by @websiteworkspace
  • πŸ‡ΊπŸ‡ΈUnited States websiteworkspace

    Just a guess ... however, might the PHP crash problem documented above be related to the following code in the source file:

    PlyrSharedTrait.php

    
    
    
    //    if ($provider === 'vimeo') {
    //      // @adjust when needed, see https://github.com/vimeo/player.js/#embed-options
    //      $vimeo = new stdClass();
    //      $vimeo->muted = TRUE;
    //      $vimeo->background = TRUE;
    //      $settings['vimeo'] = $vimeo;
    //    }
        if ($provider === 'youtube') {
          // @see https://developers.google.com/youtube/player_parameters#Parameters
          $settings['youtube'] = $this->youtubeNoCookie();
        }
        return $settings;
      }
    
      public function youtubeNoCookie(): stdClass {
        $youTube = new \stdClass();
        $youTube->noCookie = (bool) $this->settings['youtube']['noCookie'];
        return $youTube;
      }
    
    
    
Production build 0.69.0 2024