WordPress.org

Making WordPress.org

Changeset 1118


Ignore:
Timestamp:
01/09/2015 04:40:51 PM (6 years ago)
Author:
obenland
Message:

Theme Directory: Fix a bug where exisiting ticket couldn't be found.

We were looking in the wrong post meta bucket for a ticket ID.

This also removes a redundant update for the latest version's status,
and since this can now be considered a working Trac connection, enables the
fail safe in case anything goes wrong with Trac interactions.

See #745.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php

    r1116 r1118  
    218218        $ticket_id = $this->create_or_update_trac_ticket();
    219219
    220         // Temporarily disabled, until we hava a working Trac connection.
    221         if ( false /* ! $ticket_id */ ) {
     220        if ( ! $ticket_id  ) {
    222221            $this->remove_files( $this->tmp_dir );
    223222
     
    501500        // If there's a previous version, and the most current version's status is either `new` or `pending`, we update.
    502501        if ( ! empty( $this->theme_post->max_version ) && in_array( $this->theme_post->_status[ $this->theme_post->max_version ], array( 'new', 'pending' ) ) ) {
    503             $ticket_id = (int) $this->theme_post->_tickets[ $this->theme_post->max_version ];
     502            $ticket_id = (int) $this->theme_post->_ticket_id[ $this->theme_post->max_version ];
    504503            $ticket    = $this->trac->ticket_get( $ticket_id );
    505504
    506505            // Make sure the ticket has no resolution and is not approved (3 = ticket attributes).
    507506            if ( empty( $ticket[3]['resolution'] ) && 'approved' !== $ticket[3]['status'] ) {
    508                 $this->theme_post->_status[ $this->theme_post->max_version ] = 'old';
    509                 update_post_meta( $this->theme_post->ID, '_status', $this->theme_post->_status );
    510 
    511507                $result    = $this->trac->ticket_update( $ticket_id, $this->trac_ticket->description, array( 'summary' => $this->trac_ticket->summary ), true /* Trigger email notifications */ );
    512508                $ticket_id = $result ? $ticket_id : false;
Note: See TracChangeset for help on using the changeset viewer.