Ignore:
Timestamp:
Apr 3, 2013, 8:48:42 PM (11 years ago)
Author:
LucMorizur
Message:

Compliance with Piwigo 2.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/event_cats/include/evntcats_admin_funcs.inc.php

    r21652 r21996  
    137137    $t2 = 0; $t3 = false; $t4 = false;
    138138    while ( // The check is executed once at minimum
    139       !($t3 = pwg_db_fetch_row(pwg_query("
     139      (is_null($t3 = pwg_db_fetch_row(pwg_query("
    140140        SELECT `id`
    141141        FROM `".GROUPS_TABLE."`
    142142        WHERE `name` = '".$_POST['groupname']."';
    143       "))) and
     143      "))) or !$t3) and
    144144      $t2++ == 0 // The check is executed twice at maximum
    145145    )
     
    615615    }
    616616    else {
     617      // There is an issue with pwg_db_insert_id() (actually with procedures
     618      // used in pwg_db_insert_id()): if last entry has id 2,
     619      // but entries 0 and 1 have been deleted, created entry gets id 3,
     620      // but pwg_db_insert_id() returns 0. Thus is it necessary here to get
     621      // the id another way.
     622      $r = pwg_query("
     623        SELECT `id`
     624        FROM `".EVNTCATS_TABLE."`
     625        WHERE `code` = '".$ec_code."'"
     626      );
     627      $t2 = pwg_db_fetch_row($r);
     628     
    617629      build_ec_lists(); // Don't remember exactly why, but must be done here
    618630      $forced = ($forced == 'false') ? '' : l10n('ec_cnfrm_forced');
    619631      $page['infos'][] =
    620        sprintf(l10n('ec_entry_create_OK'), pwg_db_insert_id()).
     632       sprintf(l10n('ec_entry_create_OK'), $t2[0]).
    621633       $ec_code.' => '.
    622634       $ec_lists['user_ids'][$ec_user_id].$forced
Note: See TracChangeset for help on using the changeset viewer.