jenkins-bot has submitted this change and it was merged.
Change subject: Fixed handling of date field aliases in "calendar" format
......................................................................
Fixed handling of date field aliases in "calendar" format
Change-Id: Icf4680aab0d3c4b89a32c32bb1abe2263647e07f
---
M specials/CargoExport.php
1 file changed, 8 insertions(+), 5 deletions(-)
Approvals:
Yaron Koren: Checked; Looks good to me, approved
jenkins-bot: Verified
diff --git a/specials/CargoExport.php b/specials/CargoExport.php
index 15f7404..43aa0de 100644
--- a/specials/CargoExport.php
+++ b/specials/CargoExport.php
@@ -74,10 +74,13 @@
$displayedArray = array();
foreach ( $sqlQueries as $i => $sqlQuery ) {
- $dateFields = array();
- foreach( $sqlQuery->mFieldDescriptions as $field =>
$description ) {
+ $dateFieldRealNames = array();
+ $dateFieldAliases = array();
+ foreach( $sqlQuery->mFieldDescriptions as $alias =>
$description ) {
if ( $description->mType == 'Date' ||
$description->mType == 'Datetime' ) {
- $dateFields[] = $field;
+ $dateFieldAliases[] = $alias;
+ $realFieldName =
$sqlQuery->mAliasedFieldNames[$alias];
+ $dateFieldRealNames[] = $realFieldName;
}
}
@@ -86,7 +89,7 @@
$where .= " AND ";
}
$where .= "(";
- foreach ( $dateFields as $j => $dateField ) {
+ foreach ( $dateFieldRealNames as $j => $dateField ) {
if ( $j > 0 ) {
$where .= " OR ";
}
@@ -109,7 +112,7 @@
// necessarily the page name.
'title' => $eventTitle,
'url' => $title->getLocalURL(),
- 'start' => $queryResult[$dateFields[0]],
+ 'start' =>
$queryResult[$dateFieldAliases[0]],
'color' => $colorArray[$i]
);
}
--
To view, visit https://gerrit.wikimedia.org/r/200875
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icf4680aab0d3c4b89a32c32bb1abe2263647e07f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits