Plugin Directory

Changeset 3165917


Ignore:
Timestamp:
10/09/2024 03:42:58 PM (18 months ago)
Author:
janiko
Message:

1.2.0 Upgrade

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zotero-notes/trunk/class.zotero-notes-referencesList.php

    r2102112 r3165917  
    6363    function add_reference( $the_ID, $reference ) {
    6464
    65         $ref_num = count( $this->_liste_references[ $the_ID ] ) + 1;
     65        if ( empty( $this->_liste_references[ $the_ID ] ) )
     66            $ref_num = 1;
     67        else
     68            $ref_num = count( $this->_liste_references[ $the_ID ] ) + 1;
    6669        $reference->set_ref_num( $ref_num );
    6770        $this->_liste_references[ $the_ID ][] = $reference;
     
    151154   
    152155            $the_ID = get_the_ID();
    153             $count = count( $this->_liste_references[$the_ID] );
     156            if ( empty( $this->_liste_references[$the_ID] ) )
     157                $count = 0;
     158            else
     159                $count = count( $this->_liste_references[$the_ID] );
    154160           
    155161            if ( $count > 0 ) {
Note: See TracChangeset for help on using the changeset viewer.