Config schema expects keys to be in underscore case

Created on 8 March 2024, 4 months ago

In my masonry enabled view, I am getting the following notice when config inspector is enabled:

display.page_1.display_options.style.options.layoutColumnWidth	Undefined	undefined	No		missing schema	layoutColumnWidth' is not a supported key.	
display.page_1.display_options.style.options.gutterWidth	Undefined	undefined	No		missing schema	gutterWidth' is not a supported key.	
display.page_1.display_options.style.options.stampSelector	Undefined	undefined	No		missing schema	stampSelector' is not a supported key.	
display.page_1.display_options.style.options.isLayoutResizable	Undefined	undefined	No	1	missing schema	isLayoutResizable' is not a supported key.	
display.page_1.display_options.style.options.isLayoutAnimated	Undefined	undefined	No	1	missing schema	isLayoutAnimated' is not a supported key.	
display.page_1.display_options.style.options.layoutAnimationDuration	Undefined	undefined	No	500	missing schema	layoutAnimationDuration' is not a supported key.	
display.page_1.display_options.style.options.isLayoutFitsWidth	Undefined	undefined	No	0	missing schema	isLayoutFitsWidth' is not a supported key.	
display.page_1.display_options.style.options.isLayoutImagesLoadedFirst	Undefined	undefined	No	1	missing schema	isLayoutImagesLoadedFirst' is not a supported key.	
display.page_1.display_options.style.options.isLayoutImagesLazyLoaded	Undefined	undefined	No	0	missing schema	isLayoutImagesLazyLoaded' is not a supported key.	
display.page_1.display_options.style.options.isItemsWidthForce	Undefined	undefined	No	1	missing schema	isItemsWidthForce' is not a supported key.	
display.page_1.display_options.style.options.isItemsPositionInPercent	Undefined	undefined	No	0	missing schema	isItemsPositionInPercent' is not a supported key.	

From what I can tell, config schema expects keys to be in underscore case.

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom 2dareis2do

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

Comments & Activities

  • Issue created by @2dareis2do
  • πŸ‡¬πŸ‡§United Kingdom 2dareis2do
  • πŸ‡¬πŸ‡§United Kingdom 2dareis2do
      /**
       * Get default Masonry options.
       *
       * @return array
       *   An associative array of default options for Masonry.
       *   Contains:
       *   - layoutColumnWidth: The width of each column (in pixels, percentage or as
       *     a CSS selector).
       *   - gutterWidth: The spacing between each column (in pixels, percentage or as
       *     a CSS selector).
       *   - isLayoutResizable: Automatically rearrange items when the container is
       *     resized.
       *   - isLayoutAnimated: Animate item rearrangements.
       *   - layoutAnimationDuration: The duration of animations (in milliseconds).
       *   - isLayoutFitsWidth: Sets the width of the container to the nearest
       *     column. Ideal for centering Masonry layouts.
       *   - isLayoutRtlMode: Display items from right-to-left.
       *   - isLayoutImagesLoadedFirst: Load all images first before triggering
       *     Masonry.
       *   - isLayoutImagesLazyLoaded: Custom observer to support layout rebuild in
       *     lazysizes images lazy loading.
       *   - imageLazyloadSelector: lazyLoad class selector used by lazysizes.
       *   - imageLazyloadedSelector: lazyLoaded class selector used by lazysizes.
       *   - stampSelector: Specifies which elements are stamped within the layout
       *     using css selector.
       *   - isItemsWidthForce: Forces the items width to column width.
       *   - isItemsPositionInPercent: Sets item positions in percent values, rather
       *     than pixel values.
       */
      public function getMasonryDefaultOptions() {
        $options = [
          'layoutColumnWidth' => '',
          'gutterWidth' => '0',
          'isLayoutResizable' => TRUE,
          'isLayoutAnimated' => TRUE,
          'layoutAnimationDuration' => 500,
          'isLayoutFitsWidth' => FALSE,
          'isLayoutRtlMode' => ($this->languageManager->getCurrentLanguage()->getDirection() == LanguageInterface::DIRECTION_RTL),
          'isLayoutImagesLoadedFirst' => TRUE,
          'isLayoutImagesLazyLoaded' => FALSE,
          'imageLazyloadSelector' => 'lazyload',
          'imageLazyloadedSelector' => 'lazyloaded',
          'stampSelector' => '',
          'isItemsWidthForce' => TRUE,
          'isItemsPositionInPercent' => FALSE,
          'extraOptions' => [],
        ];
    
        // Loazyloading classes are auto-calculated for user simplicity. When
        // lazysizes is used without a Drupal module, this means DX is able to use
        // hook_masonry_default_options_alter or hook_masonry_options_form_alter to
        // override this setting.
        if ($this->moduleHandler->moduleExists('lazy')) {
          $config = $this->configFactory->get('lazy.settings');
          $options['imageLazyloadSelector'] = $config->get('lazysizes.lazyClass');
          $options['imageLazyloadedSelector'] = $config->get('lazysizes.loadedClass');
        }
    
        return $options;
      }
Production build 0.69.0 2024