Skip to content
Snippets Groups Projects
Commit cae640d3 authored by catch's avatar catch
Browse files

Issue #3261452 by Spokje, andypost, naveenvalecha, quietone, smustgrave:...

Issue #3261452 by Spokje, andypost, naveenvalecha, quietone, smustgrave: [11.x] Remove tracker module from core
parent 52983559
No related branches found
No related tags found
27 merge requests!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!9470[10.3.x-only-DO-NOT-MERGE]: #3331771 Fix file_get_contents(): Passing null to parameter,!8540Issue #3457061: Bootstrap Modal dialog Not closing after 10.3.0 Update,!8528Issue #3456871 by Tim Bozeman: Support NULL services,!8373Issue #3427374 by danflanagan8, Vighneshh: taxonomy_tid ViewsArgumentDefault...,!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3651Issue #3347736: Create new SDC component for Olivero (header-search),!3531Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3355Issue #3209129: Scrolling problems when adding a block via layout builder,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2794Issue #3100732: Allow specifying `meta` data on JSON:API objects,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2062Issue #3246454: Add weekly granularity to views date sort,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #151684 canceled
Pipeline: drupal

#151685

    Showing
    with 2 additions and 254 deletions
    ......@@ -27,7 +27,6 @@
    "modules/statistics/tests/fixtures/drupal6.php",
    "modules/statistics/tests/fixtures/drupal7.php",
    "modules/system/tests/logo.svgz",
    "modules/tracker/tests/fixtures/drupal7.php",
    "node_modules/*",
    "profiles/demo_umami/modules/demo_umami_content/default_content/languages/es/**/*",
    "tests/fixtures/files/*",
    ......
    ......@@ -404,9 +404,6 @@ Toolbar
    Tour
    - Nick Schuch 'nick_schuch' https://www.drupal.org/u/nick_schuch
    Tracker
    - ?
    Transliteration
    - Andrei Mateescu 'amateescu' https://www.drupal.org/u/amateescu
    ......
    ......@@ -57,8 +57,6 @@ class MigrationPluginListTest extends KernelTestBase {
    'system',
    'taxonomy',
    'text',
    // @todo Remove tracker in https://www.drupal.org/project/drupal/issues/3261452
    'tracker',
    'update',
    'user',
    ];
    ......
    ......@@ -36,8 +36,6 @@ finished:
    ping: core
    poll: core
    throttle: core
    # @todo Remove tracker in https://www.drupal.org/project/drupal/issues/3261452
    tracker: core
    translation: core
    trigger: core
    variable: core
    ......
    ......@@ -76,8 +76,6 @@ class StateFileExistsTest extends MigrateDrupalTestBase {
    'taxonomy',
    'telephone',
    'text',
    // @todo Remove tracker in https://www.drupal.org/project/drupal/issues/3261452
    'tracker',
    'update',
    'user',
    ];
    ......
    ......@@ -44,8 +44,6 @@ protected function setUp(): void {
    $this->installSchema('forum', ['forum_index']);
    $this->installSchema('node', ['node_access']);
    $this->installSchema('search', ['search_dataset']);
    // @todo Remove tracker in https://www.drupal.org/project/drupal/issues/3261452
    $this->installSchema('tracker', ['tracker_node', 'tracker_user']);
    // Enable content moderation for nodes of type page.
    $this->installEntitySchema('content_moderation_state');
    ......
    ......@@ -42,8 +42,6 @@ protected function setUp(): void {
    $this->installSchema('forum', ['forum_index']);
    $this->installSchema('node', ['node_access']);
    $this->installSchema('search', ['search_dataset']);
    // @todo Remove tracker in https://www.drupal.org/project/drupal/issues/3261452
    $this->installSchema('tracker', ['tracker_node', 'tracker_user']);
    // Enable content moderation for nodes of type page.
    $this->installEntitySchema('content_moderation_state');
    ......
    ......@@ -121,8 +121,6 @@ protected function getAvailablePaths() {
    'Taxonomy',
    'Text',
    'Throttle',
    // @todo Remove Tracker in https://www.drupal.org/project/drupal/issues/3261452
    'Tracker',
    'Trigger',
    'Update status',
    'Upload',
    ......@@ -151,6 +149,7 @@ protected function getMissingPaths() {
    'Devel node access',
    'Forum',
    'Statistics',
    'Tracker',
    // Option Widgets is set not_finished in migrate_state_not_finished_test.
    'Option Widgets',
    'Views',
    ......
    ......@@ -107,8 +107,6 @@ protected function getAvailablePaths() {
    'Taxonomy',
    'Text',
    'Throttle',
    // @todo Remove tracker in https://www.drupal.org/project/drupal/issues/3261452
    'Tracker',
    'Trigger',
    'Update status',
    'Upload',
    ......@@ -157,6 +155,7 @@ protected function getMissingPaths() {
    'String translation',
    'Synchronize translations',
    'Taxonomy translation',
    'Tracker',
    'Views',
    'Views translation',
    ];
    ......
    ......@@ -166,7 +166,6 @@ protected function getMissingPaths() {
    'References',
    'References UUID',
    'Statistics',
    // @todo Remove tracker in https://www.drupal.org/project/drupal/issues/3261452
    'Tracker',
    'Translation redirect',
    'Translation sets',
    ......
    ......@@ -179,7 +179,6 @@ protected function getMissingPaths() {
    // These modules are in the missing path list because they are installed
    // on the source site but they are not installed on the destination site.
    'Syslog',
    // @todo Remove tracker in https://www.drupal.org/project/drupal/issues/3261452
    'Tracker',
    'Update manager',
    ];
    ......
    ......@@ -215,7 +215,6 @@ protected function getMissingPaths() {
    // These modules are in the missing path list because they are installed
    // on the source site but they are not installed on the destination site.
    'Syslog',
    // @todo Remove tracker in https://www.drupal.org/project/drupal/issues/3261452
    'Tracker',
    'Update manager',
    ];
    ......
    cron_index_limit: 1000
    # Schema for the configuration files of the tracker module.
    tracker.settings:
    type: config_object
    label: 'Tracker settings'
    mapping:
    cron_index_limit:
    type: integer
    label: 'Cron index limit'
    # Schema for the views plugins of the Tracker module.
    views.argument.tracker_user_uid:
    type: views.argument.argument_comment_user_uid
    label: 'Nodes user posted/commented on'
    views.filter.tracker_user_uid:
    type: views.filter.user_name
    label: 'UID of a nodes user posted/commented on'
    ---
    label: 'Viewing lists of recently-updated content'
    related:
    - core.tracking_content
    - history.tracking_user_content
    ---
    {% set recent_link_text %}
    {% trans %}Recent content{% endtrans %}
    {% endset %}
    {% set recent_link = render_var(help_route_link(recent_link_text, 'tracker.page')) %}
    <h2>{% trans %}What displays of recently-updated content are available?{% endtrans %}</h2>
    <p>{% trans %}Assuming that you have the core Activity Tracker module installed, these pages that show recently-updated content are available:{% endtrans %}</p>
    <ul>
    <li>{% trans %}{{ recent_link }}: Shows the content that has been most recently added, updated, or commented on.{% endtrans %}</li>
    <li>{% trans %}The <em>My recent content</em> tab on the <em>Recent content</em> page (for logged-in users) limits the list to content created or commented on by the user viewing the page.{% endtrans %}</li>
    <li>{% trans %}The <em>Activity</em> tab on a user profile shows the same list for the user whose profile is being viewed.{% endtrans %}</li>
    </ul>
    /**
    * Attaches behaviors for the Tracker module's History module integration.
    *
    * May only be loaded for authenticated users, with the History module enabled.
    */
    (function ($, Drupal, window) {
    function processNodeNewIndicators(placeholders) {
    const newNodeString = Drupal.t('new');
    const updatedNodeString = Drupal.t('updated');
    placeholders.forEach((placeholder) => {
    const timestamp = parseInt(
    placeholder.getAttribute('data-history-node-timestamp'),
    10,
    );
    const nodeID = placeholder.getAttribute('data-history-node-id');
    const lastViewTimestamp = Drupal.history.getLastRead(nodeID);
    if (timestamp > lastViewTimestamp) {
    const message =
    lastViewTimestamp === 0 ? newNodeString : updatedNodeString;
    $(placeholder).append(`<span class="marker">${message}</span>`);
    }
    });
    }
    function processNewRepliesIndicators(placeholders) {
    // Figure out which placeholders need the "x new" replies links.
    const placeholdersToUpdate = {};
    placeholders.forEach((placeholder) => {
    const timestamp = parseInt(
    placeholder.getAttribute('data-history-node-last-comment-timestamp'),
    10,
    );
    const nodeID = placeholder.previousSibling.previousSibling.getAttribute(
    'data-history-node-id',
    );
    const lastViewTimestamp = Drupal.history.getLastRead(nodeID);
    // Queue this placeholder's "X new" replies link to be downloaded from the
    // server.
    if (timestamp > lastViewTimestamp) {
    placeholdersToUpdate[nodeID] = placeholder;
    }
    });
    // Perform an AJAX request to retrieve node view timestamps.
    const nodeIDs = Object.keys(placeholdersToUpdate);
    if (nodeIDs.length === 0) {
    return;
    }
    $.ajax({
    url: Drupal.url('comments/render_new_comments_node_links'),
    type: 'POST',
    data: { 'node_ids[]': nodeIDs },
    dataType: 'json',
    success(results) {
    Object.keys(results || {}).forEach((nodeID) => {
    if (placeholdersToUpdate.hasOwnProperty(nodeID)) {
    const url = results[nodeID].first_new_comment_link;
    const text = Drupal.formatPlural(
    results[nodeID].new_comment_count,
    '1 new',
    '@count new',
    );
    $(placeholdersToUpdate[nodeID]).append(
    `<br /><a href="${url}">${text}</a>`,
    );
    }
    });
    },
    });
    }
    /**
    * Render "new" and "updated" node indicators, as well as "X new" replies links.
    */
    Drupal.behaviors.trackerHistory = {
    attach(context) {
    // Find all "new" comment indicator placeholders newer than 30 days ago that
    // have not already been read after their last comment timestamp.
    const nodeIDs = [];
    const nodeNewPlaceholders = once(
    'history',
    '[data-history-node-timestamp]',
    context,
    ).filter((placeholder) => {
    const nodeTimestamp = parseInt(
    placeholder.getAttribute('data-history-node-timestamp'),
    10,
    );
    const nodeID = placeholder.getAttribute('data-history-node-id');
    if (Drupal.history.needsServerCheck(nodeID, nodeTimestamp)) {
    nodeIDs.push(nodeID);
    return true;
    }
    return false;
    });
    // Find all "new" comment indicator placeholders newer than 30 days ago that
    // have not already been read after their last comment timestamp.
    const newRepliesPlaceholders = once(
    'history',
    '[data-history-node-last-comment-timestamp]',
    context,
    ).filter((placeholder) => {
    const lastCommentTimestamp = parseInt(
    placeholder.getAttribute('data-history-node-last-comment-timestamp'),
    10,
    );
    const nodeTimestamp = parseInt(
    placeholder.previousSibling.previousSibling.getAttribute(
    'data-history-node-timestamp',
    ),
    10,
    );
    // Discard placeholders that have zero comments.
    if (lastCommentTimestamp === nodeTimestamp) {
    return false;
    }
    const nodeID = placeholder.previousSibling.previousSibling.getAttribute(
    'data-history-node-id',
    );
    if (Drupal.history.needsServerCheck(nodeID, lastCommentTimestamp)) {
    if (nodeIDs.indexOf(nodeID) === -1) {
    nodeIDs.push(nodeID);
    }
    return true;
    }
    return false;
    });
    if (
    nodeNewPlaceholders.length === 0 &&
    newRepliesPlaceholders.length === 0
    ) {
    return;
    }
    // Fetch the node read timestamps from the server.
    Drupal.history.fetchTimestamps(nodeIDs, () => {
    processNodeNewIndicators(nodeNewPlaceholders);
    processNewRepliesIndicators(newRepliesPlaceholders);
    });
    },
    };
    })(jQuery, Drupal, window);
    id: d7_tracker_node
    label: Tracker node
    migration_tags:
    - Drupal 7
    - Content
    source:
    plugin: d7_tracker_node
    process:
    nid: nid
    published: published
    changed: changed
    destination:
    plugin: entity:node
    migration_dependencies:
    required:
    - d7_user
    id: d7_tracker_settings
    label: Tracker settings
    migration_tags:
    - Drupal 7
    - Configuration
    source:
    plugin: variable
    variables:
    - tracker_batch_size
    source_module: tracker
    process:
    cron_index_limit: tracker_batch_size
    destination:
    plugin: config
    config_name: tracker.settings
    id: d7_tracker_user
    label: Tracker user
    migration_tags:
    - Drupal 7
    - Content
    source:
    plugin: d7_tracker_user
    process:
    nid: nid
    uid: uid
    published: published
    changed: changed
    destination:
    plugin: entity:user
    migration_dependencies:
    required:
    - d7_user
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment