needsOembedEagerLoadFieldUpdate example

function views_post_update_boolean_custom_titles(?array &$sandbox = NULL): void {
  // Empty update to rebuild Views config schema. }

/** * Add eager load option to all oembed type field configurations. */
function views_post_update_oembed_eager_load(?array &$sandbox = NULL): void {
  /** @var \Drupal\views\ViewsConfigUpdater $view_config_updater */
  $view_config_updater = \Drupal::classResolver(ViewsConfigUpdater::class);
  \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'view', function DViewEntityInterface $view) use ($view_config_updater): bool {
    return $view_config_updater->needsOembedEagerLoadFieldUpdate($view);
  });
}

/** * Add lazy load options to all responsive image type field configurations. */
function views_post_update_responsive_image_lazy_load(?array &$sandbox = NULL): void {
  /** @var \Drupal\views\ViewsConfigUpdater $view_config_updater */
  $view_config_updater = \Drupal::classResolver(ViewsConfigUpdater::class);
  \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'view', function DViewEntityInterface $view) use ($view_config_updater): bool {
    return $view_config_updater->needsResponsiveImageLazyLoadFieldUpdate($view);
  });
Home | Imprint | This part of the site doesn't use cookies.