r109944 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109943‎ | r109944 | r109945 >
Date:20:00, 24 January 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
bug 33930 - patch by John McClure
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_SetRecurringEvent.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php
@@ -23,8 +23,10 @@
2424 *
2525 * @param Parser $parser
2626 * @param string $text
 27+ *
 28+ * @return true
2729 */
28 - static public function onInternalParseBeforeLinks( &$parser, &$text ) {
 30+ static public function onInternalParseBeforeLinks( Parser &$parser, &$text ) {
2931 global $smwgStoreAnnotations, $smwgLinksInValues;
3032
3133 SMWParseData::stripMagicWords( $text, $parser );
Index: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_SetRecurringEvent.php
@@ -197,7 +197,8 @@
198198 }
199199
200200 $date_str = "$cur_year-$display_month-$cur_day $cur_time";
201 - $cur_date = SMWDataValueFactory::newTypeIDValue( '_dat', $date_str );
 201+ $all_date_strings = array_merge( $all_date_strings, $included_dates);
 202+ $cur_date_jd = $cur_date->getDataItem()->getJD();
202203 } elseif ( $unit == 'dayofweekinmonth' ) {
203204 // e.g., "3rd Monday of every month"
204205 $prev_month = $cur_date->getMonth();
@@ -255,7 +256,7 @@
256257 } while ( !$reached_end_date );
257258
258259 // Handle the 'include' dates as well.
259 - $all_date_strings = array_merge( $all_date_strings, $included_dates);
 260+ $all_date_strings = array_filter( array_merge( $all_date_strings, $included_dates ) );
260261
261262 return array( $property_name, $all_date_strings, $unused_params );
262263 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r114480Fix for r109944 - re-added a line that was necessary for the 'month' and 'yea...yaron14:59, 25 March 2012