[11.x] [Meta] Tasks to remove Book

Created on 21 July 2023, 11 months ago
Updated 21 May 2024, about 1 month ago

Problem/Motivation

Track the steps needed to remove extension Book from core to contrib. See Remove a core module and move it to a contributed project β†’ of the deprecation policy.

The removal of extension Book was approved in πŸ“Œ [Policy] Move book to contrib in Drupal 11 Fixed .

Remaining tasks

postponed on πŸ“Œ Ensure that Book does not get special core treatment Needs review

  1. Create a child issue, 'Remove Book from core'. πŸ“Œ Remove Book module Postponed
  2. Deprecate the extension in the current minor development branch. If the next major branch is open, the extension can be removed via a separate patch (to avoid dependent patches), otherwise an issue should be opened to remove the extension once the next major branch is open.
  3. Open an issue, 'Ensure that Book does not get special core treatment' in the packages.drupal.org issue queue β†’ to ensure that the composer namespace for the contributed project matches the core one after removal. This is to allocate the drupal/Book Composer namespace to contrib extension rather than the core extension.
  4. Manually test upgrading from the core extension to the contrib extension.
  5. Triage core issues for Book in the core queue and move either to the contrib project or the relevant core component. Restore the status to what it was before it was postponed.
  6. Move all core documentation for Book to the contrib project.
  7. When the issue in https://www.drupal.org/project/project_composer β†’ is Fixed update the documentation with the new Composer command.

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

11.0 πŸ”₯

Component
BookΒ  β†’

Last updated 11 minutes ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

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

Comments & Activities

  • Issue created by @quietone
  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

    One more thing to tackle when moving Book to contrib is to rename its memory cache service name. It should be cache.book_memory, not book.memory_cache as the latter leads to the ambiguous bin name "memory_cache", which could mean anything.

    See #3402850-12: Fix MemoryCache discovery and DX β†’ and ListCacheBinsPass, CacheFactory after that issue lands to understand how this bin name can mess things up.

  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand
  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand
  • Status changed to Active 3 months ago
  • πŸ‡¬πŸ‡§United Kingdom catch
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I'm happy to create children issues if they are required, but I found some additional references to Book and since the remove Book from core has already been marked as fixed I thought I'd post them here for consideration.

    I was investigating: core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php
    Because it seems to be going very slow in tests and found the following.

    There are a lot of references to book in migration tests, but I assume most of them should remain since we can still migrate from Drupal 6 and 7 feel free to correct me if I misunderstood.

    // The 'book' module provides the 'book' node type, and the migration
          // creates 12 node types.
          'node_type' => 13,
    

    That lead to a quick search and I also found the following that I think *should* can be cleaned up.
    cspell is ignoring two non existent paths:
    "modules/book/tests/fixtures/drupal6.php",
    "modules/book/tests/fixtures/drupal7.php",

    EntityFormBuilderInterface uses book as an example:
    _entity_form: node.book_outline

    BlockCacheTest.php
    Comment referencing book.

    Umami has a bunch of classy templates for book.

    Let me know if any of these need follow ups, or if they have already been addressed elsewhere and should remain as is. I did try searching for other issues.

  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

    @nicxvan, thanks for the searching! It really helps to make sure that we remove everything.

    Yes, make issues for the following, all as children of this isssue.

    1. An issue to update cspell.json for all extension removals.
    2. An issue to change all comments to not use 'book'.
    3. An issue to remove the usages of book from Umami. And an issue in the Book module to get those changes.

    And, the speed of those migrate tests is fixed in πŸ› Reduce time of Migrate Upgrade tests by not outputting the logs by default RTBC .

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Ok I created the children issues, I was not super clear on what you meant by `And an issue in the Book module to get those changes.`

    I created a stub on the book module and related it here, let me know if you meant something else.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    There are a couple more items I am unsure of:

    BlockSettings.php

    case 'aggregator_feed_block':
            [, $id] = explode('-', $delta);
            $settings['block_count'] = $old_settings['aggregator']['item_count'];
            $settings['feed'] = $id;
            break;
    
          case 'book_navigation':
            $settings['block_mode'] = $old_settings['book']['block_mode'];
            break;
    
          case 'forum_active_block':
          case 'forum_new_block':
            $settings['block_count'] = $old_settings['forum']['block_num'];
            break;
    
          case 'statistics_popular_block':
            $settings['top_day_num'] = $old_settings['statistics']['statistics_block_top_day_num'];
            $settings['top_all_num'] = $old_settings['statistics']['statistics_block_top_all_num'];
            $settings['top_last_num'] = $old_settings['statistics']['statistics_block_top_last_num'];
            break;
    
          case 'views_block:who_s_new-block_1':
            $settings['items_per_page'] = $old_settings['user']['block_whois_new_count'];
            break;
    
          case 'views_block:who_s_online-who_s_online_block':
            $settings['items_per_page'] = $old_settings['user']['max_list_count'];
            break;
    

    Block.php

    case 'aggregator':
            [$type, $id] = explode('-', $delta);
            if ($type == 'feed') {
              $item_count = $this->select('aggregator_feed', 'af')
                ->fields('af', ['block'])
                ->condition('fid', $id)
                ->execute()
                ->fetchField();
            }
            else {
              $item_count = $this->select('aggregator_category', 'ac')
                ->fields('ac', ['block'])
                ->condition('cid', $id)
                ->execute()
                ->fetchField();
            }
            $settings['aggregator']['item_count'] = $item_count;
            break;
    
          case 'book':
            $settings['book']['block_mode'] = $this->variableGet('book_block_mode', 'all pages');
            break;
    
          case 'forum':
            $settings['forum']['block_num'] = $this->variableGet('forum_block_num_' . $delta, 5);
            break;
    
          case 'statistics':
            foreach (['statistics_block_top_day_num', 'statistics_block_top_all_num', 'statistics_block_top_last_num'] as $name) {
              $settings['statistics'][$name] = $this->variableGet($name, 0);
            }
            break;
    
          case 'user':
            switch ($delta) {
              case 2:
              case 'new':
                $settings['user']['block_whois_new_count'] = $this->variableGet('user_block_whois_new_count', 5);
                break;
    
              case 3:
              case 'online':
                $settings['user']['block_seconds_online'] = $this->variableGet('user_block_seconds_online', 900);
                $settings['user']['max_list_count'] = $this->variableGet('user_block_max_list_count', 10);
                break;
            }
            break;
    

    Everything else I saw was part of Migrate, MigrateTests or block configuration for drupal 6 or 7.
    Or it already has a related issue.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Composer ticket is in review πŸ“Œ Ensure that Book does not get special core treatment Needs review

    Down to 30 issues to triage in the queue, hopefully finish this weekend

    Moved core documentation page https://www.drupal.org/docs/8/core/modules/book β†’ to Contributed module documentation

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Believe we just waiting on πŸ“Œ Ensure that Book does not get special core treatment Needs review now

  • Status changed to Needs work about 2 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

    There are also questions asked in #9 that need to be answered.

    For #9, BlockSettings.php is a migrate process plugin and Block.php is a migrate source plugin. it was decided to keep the migrations related to modules removed from core, In those classes there is also code for aggregator, which was removed in Drupal 10. So, there is nothing to do there.

    I checked the core and book issue queue and confirmed that the issues have been moved. I checked that the docs have been moved and the URLs are correct. The docs are also in the correct menu.

    Still to do

  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

    Confirming that Book is not in the menu of Core modules. https://www.drupal.org/docs/develop/core-modules-and-themes/core-modules β†’

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Thanks, I missed that those were part of migrate. I think that makes sense since the other migrate pieces are staying in core.

  • Status changed to Postponed about 2 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

    NP.

    I searched the core change records and found some that needed to move various extensions that have been moved to contrib. So, I think that part is done.

    Postponing on πŸ“Œ Ensure that Book does not get special core treatment Needs review

  • Status changed to Needs review about 2 months ago
  • πŸ‡«πŸ‡·France andypost

    Composer facade fixed

  • Status changed to Fixed about 2 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

    Nice. And using composer require drupal/book does install book module on 11.

  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

    Created πŸ“Œ Rename book.memory_cache to cache.book_memory Active as per my comment in #2.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024