Last modified: 2012-01-24 20:00:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35930, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33930 - missing line in smw_setrecurringevent.php
missing line in smw_setrecurringevent.php
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-24 18:41 UTC by John McClure
Modified: 2012-01-24 20:00 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description John McClure 2012-01-24 18:41:42 UTC

    
Comment 1 John McClure 2012-01-24 18:44:21 UTC
looks to me like cur_date_jd is never reset after its initial value... so i've added the following to SMW_SetRecurringDate.php @189..

                $cur_date_jd = $cur_date->getDataItem()->getJD(); #jmc

It runs as expected now, stopping at the correct iteration.
Comment 2 Jeroen De Dauw 2012-01-24 19:13:43 UTC
Line 189 in what version? Trunk?

Is it the line after "if ( $unit == 'year' ) {" ?
Comment 3 John McClure 2012-01-24 19:20:08 UTC
@line 41 there is a null entry in the array (which stores today's date), so...
foreach ( $all_date_strings as $date_str ) {
        if( $date_str ){
          SMWParseData::addProperty( $property_name, $date_str, false, $parser,
true );
            }
        }
Comment 4 John McClure 2012-01-24 19:20:51 UTC
(In reply to comment #2)
> Line 189 in what version? Trunk?
> 
> Is it the line after "if ( $unit == 'year' ) {" ?

Not sure but line 189 has
$cur_date = SMWDataValueFactory::newTypeIDValue( '_dat', $date_str );
Comment 5 John McClure 2012-01-24 19:27:50 UTC
to remove nulls better code is:
        $all_date_strings = array_filter($all_date_strings); #remove nulls
Comment 6 Jeroen De Dauw 2012-01-24 19:30:46 UTC
Sorry, I can't follow that. Can you provide a patch against trunk?
Comment 7 John McClure 2012-01-24 19:43:49 UTC
at line 188:

$cur_date = SMWDataValueFactory::newTypeIDValue( '_dat', $date_str );
//add: recalc cur_date_jd 
cur_date_jd = $cur_date->getDataItem()->getJD(); 

at line 247:
$all_date_strings = array_merge( $all_date_strings, $included_dates);
//add: remove nulls from the dates array
$all_date_strings = array_filter($all_date_strings);
Comment 8 Jeroen De Dauw 2012-01-24 20:00:58 UTC
r109944

Thanks for the patch :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links