ADVAGG_CDN is not available for drupal 10

Created on 25 August 2023, 10 months ago
Updated 18 June 2024, 9 days ago

Problem/Motivation

ADVAGG_CDN is not available for drupal 10

Steps to reproduce

Install composer require 'drupal/advagg:^6.0@alpha'
Enable all the advagg module and try to access the same
Check for CDN tab , it was available for drupal 8/9 but not for D10.
I started working for D10 update , have dependency for the same.
Can you please help me on that how can we use this module for D10 ?

🐛 Bug report
Status

Active

Version

6.0

Component

CDN

Created by

🇮🇳India ishwar

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

Comments & Activities

  • Issue created by @ishwar
  • 🇺🇸United States ZhuRenTongKu

    I know this post is a little old, however, if you're just trying to load the jquery.min.js file from Google's CDN, the following will work. Can be placed in any custom module you've got.

    
    /**
     * Implements hook_js_alter().
     */
    function MY_MODULE_js_alter(&$javascript) {
      $module_handler = \Drupal::service('module_handler');
      $advagg_exists = $module_handler->moduleExists('advagg_cdn');
    
      if ($advagg_exists) {
        return;
      }
    
      // Modified from advagg_cdn module.  This module was removed from 6.0 version.
      // Get JQuery from Google cdn.
      $jquery_lib = 'core/assets/vendor/jquery/jquery.min.js';
      if (!empty($javascript[$jquery_lib])) {
        $url = 'https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js';
        $javascript[$jquery_lib]['type'] = 'external';
        $javascript[$jquery_lib]['data'] = $url;
        $javascript[$jquery_lib]['version'] = '3.5.1';
      }
    }
    
Production build 0.69.0 2024