Skip to main content
Culture is Life

Main navigation

  • Home
  • Technical
  • About
  • Contact
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Technical

[Drupal] 在 Drupal 9 繼續使用 Drupal 8 相容的模組

By gloomcheng, Wed, 10/26/2022 - 22:19

Drupal 8 要升級至 Drupal 9,最麻煩的環節應該是部分模組沒有支援 Drupal 9,且許多 Drupal 8 的模組開發者也沒有要繼續維護的打算,導致在使用 composer 升級時,會因為這些模組的相依性限制,而無法順利升級到 Drupal 9。

遇到這種問題,比較好的解決方案,建議在 composer 加入 Lenient 儲存庫1:

$ composer config repositories.lenient composer https://packages.drupal.org/lenient 

加入後的 composer.json 會類似下面的結果

    "repositories": {
        "lenient": {
            "type": "composer",
            "url": "https://packages.drupal.org/lenient"
        },
        "0": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    },

當然,除了採用 Lenient 儲存庫外,也可以自行修改那些未升級模組的 info.yml 檔案,自行加入相容 Drupal 9 的設定。但不論哪種方法,要注意未升級模組的程式碼是否完全相容 Drupal 9/10。


  1. Using Drupal's Lenient Composer Endpoint ↩

Categories

  • Drupal 8
  • Drupal 9+
  • Composer

Comments

About text formats

Plain text

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.
RSS feed
Powered by Drupal