Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b5ec3fecad85
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 332da7ffce36
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 6, 2013

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ae6730a View commit details
  2. Copy the full SHA
    332da7f View commit details
Showing with 10 additions and 12 deletions.
  1. +8 −10 core/sponsorship_api.php
  2. +2 −2 static/javascript/common.js
18 changes: 8 additions & 10 deletions core/sponsorship_api.php
Original file line number Diff line number Diff line change
@@ -105,11 +105,10 @@ class SponsorshipData {
* if the sponsorship can't be found. If the second parameter is
* false, return false if the sponsorship can't be found.
* @param int $p_sponsorship_id
* @param bool $p_trigger_errors
* @return array
* @throws MantisBT\Exception\Sponsorship\SponsorshipNotFound
*/
function sponsorship_cache_row( $p_sponsorship_id, $p_trigger_errors = true ) {
function sponsorship_cache_row( $p_sponsorship_id ) {
global $g_cache_sponsorships;

$c_sponsorship_id = (int)$p_sponsorship_id;
@@ -124,13 +123,7 @@ function sponsorship_cache_row( $p_sponsorship_id, $p_trigger_errors = true ) {
$row = db_fetch_array( $result );

if( !$row ) {
$g_cache_sponsorships[$c_sponsorship_id] = false;

if( $p_trigger_errors ) {
throw new MantisBT\Exception\Sponsorship\SponsorshipNotFound( $p_sponsorship_id );
} else {
return false;
}
throw new MantisBT\Exception\Sponsorship\SponsorshipNotFound( $p_sponsorship_id );
}

$g_cache_sponsorships[$c_sponsorship_id] = $row;
@@ -161,7 +154,12 @@ function sponsorship_clear_cache( $p_sponsorship_id = null ) {
* @return bool
*/
function sponsorship_exists( $p_sponsorship_id ) {
return sponsorship_cache_row( $p_sponsorship_id, false ) !== false;
try {
sponsorship_cache_row( $p_sponsorship_id );
} catch ( MantisBT\Exception\Sponsorship\SponsorshipNotFound $e ) {
return false;
}
return true;
}

/**
4 changes: 2 additions & 2 deletions static/javascript/common.js
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ $(document).ready( function() {
$('#project-selector').children('.button').hide();
setBugLabel();

$('input[type=checkbox]#use_date_filters').live('click', function() {
$(document).on('click', 'input[type=checkbox]#use_date_filters', function() {
if (!$(this).is(':checked')) {
$('div.filter-box select[name=start_year]').prop('disabled', true);
$('div.filter-box select[name=start_month]').prop('disabled', true);
@@ -230,7 +230,7 @@ $(document).ready( function() {
}
});

$('#tag_select').live('change', function() {
$(document).on('change', '#tag_select', function() {
var tagSeparator = $('#tag_separator').val();
var currentTagString = $('#tag_string').val();
var newTagOptionID = $(this).val();