Making WordPress.org

Changeset 10479


Ignore:
Timestamp:
12/01/2020 05:59:22 AM (4 years ago)
Author:
dd32
Message:

Trac: Mentions handler: Disable two functions that no longer work (and haven't done so for a long time).

This PHP handler can no longer access the trac ticket subscriptions table directly, and so can't check to see if a user has blocked subscription emails or not.

See #3594.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/mentions-handler.php

    r10478 r10479  
    1313
    1414$payload = json_decode( wp_unslash( $_POST['payload'] ) );
    15 
    16 // Debug to figure out why the incoming JSON is sometimes not able to be parsed, despite appearing to be valid.
    17 if ( ! $payload ) {
    18     slack_dm( var_export( $_POST, true ), 'dd32' );
    19 }
    2015
    2116require_once WP_PLUGIN_DIR . '/wporg-notifications.php';
     
    5146
    5247function wporg_get_trac_ticket_subscription_status( $username, $ticket ) {
     48    /*
     49     * TODO: This no longer works.
     50     *
     51     * The _ticket_subs table is no longer accessible from PHP, as Trac doesn't use MySQL accessible via HyperDB.
     52     *
     53     * The replacement is a HTTP API call via Trac_Notifications_API::get_trac_ticket_subscription_status_for_user( $ticket, $username )
     54     */
     55/*
    5356    global $wpdb;
    5457    add_db_table( 'trac_core', '_ticket_subs' ); // HyperDB
     
    6164        return (int) $status;
    6265    }
     66*/
    6367    return false;
    6468}
     
    112116        // If on Core Trac, a user is not a reporter, owner, or subscriber, subscribe them.
    113117        if ( isset( $status ) && false === $status ) {
     118            /*
     119             * TODO: This no longer works.
     120             *
     121             * The _ticket_subs table is no longer accessible from PHP, as Trac doesn't use MySQL accessible via HyperDB.
     122             *
     123             * Trac_Notifications_API does not have a replacement function.
     124            */
     125            /*
    114126            $wpdb->insert( '_ticket_subs', array(
    115127                'username' => $username,
     
    117129                'status'   => MENTIONED,
    118130            ) );
     131            */
    119132        }
    120133
Note: See TracChangeset for help on using the changeset viewer.