[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Changed forminput autocompletion to always be remote

2017-11-26 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393518 )

Change subject: Changed forminput autocompletion to always be remote
..


Changed forminput autocompletion to always be remote

Local autocompletion sometimes didn't work, apparently due to caching.

Change-Id: Ic44fac5ded23ebf4cc5511260d7c9ffe019fc6e0
---
M includes/PF_ParserFunctions.php
1 file changed, 7 insertions(+), 10 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/PF_ParserFunctions.php b/includes/PF_ParserFunctions.php
index 02017cf..be102d1 100644
--- a/includes/PF_ParserFunctions.php
+++ b/includes/PF_ParserFunctions.php
@@ -303,16 +303,13 @@
$inputID = 'input_' . $input_num;
$formInputAttrs['id'] = $inputID;
$formInputAttrs['class'] = 'autocompleteInput 
createboxInput formInput';
-   global $wgPageFormsMaxLocalAutocompleteValues;
-   $autocompletion_values = 
PFValuesUtils::getAutocompleteValues( $inAutocompletionSource, 
$autocompletionType );
-   if ( count( $autocompletion_values ) > 
$wgPageFormsMaxLocalAutocompleteValues ) {
-   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
-   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
-   } else {
-   global $wgPageFormsAutocompleteValues;
-   $wgPageFormsAutocompleteValues[$inputID] = 
$autocompletion_values;
-   $formInputAttrs['autocompletesettings'] = 
$inputID;
-   }
+   // This code formerly only used remote autocompletion
+   // when the number of autocompletion values was above
+   // a certain limit - as happens in regular forms -
+   // but local autocompletion didn't always work,
+   // apparently due to page caching.
+   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
+   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
}
 
// The value has already been HTML-encoded as a parameter,

-- 
To view, visit https://gerrit.wikimedia.org/r/393518
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic44fac5ded23ebf4cc5511260d7c9ffe019fc6e0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Changed forminput autocompletion to always be remote

2017-11-26 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393518 )

Change subject: Changed forminput autocompletion to always be remote
..

Changed forminput autocompletion to always be remote

Local autocompletion sometimes didn't work, apparently due to caching.

Change-Id: Ic44fac5ded23ebf4cc5511260d7c9ffe019fc6e0
---
M includes/PF_ParserFunctions.php
1 file changed, 7 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/18/393518/2

diff --git a/includes/PF_ParserFunctions.php b/includes/PF_ParserFunctions.php
index 02017cf..be102d1 100644
--- a/includes/PF_ParserFunctions.php
+++ b/includes/PF_ParserFunctions.php
@@ -303,16 +303,13 @@
$inputID = 'input_' . $input_num;
$formInputAttrs['id'] = $inputID;
$formInputAttrs['class'] = 'autocompleteInput 
createboxInput formInput';
-   global $wgPageFormsMaxLocalAutocompleteValues;
-   $autocompletion_values = 
PFValuesUtils::getAutocompleteValues( $inAutocompletionSource, 
$autocompletionType );
-   if ( count( $autocompletion_values ) > 
$wgPageFormsMaxLocalAutocompleteValues ) {
-   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
-   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
-   } else {
-   global $wgPageFormsAutocompleteValues;
-   $wgPageFormsAutocompleteValues[$inputID] = 
$autocompletion_values;
-   $formInputAttrs['autocompletesettings'] = 
$inputID;
-   }
+   // This code formerly only used remote autocompletion
+   // when the number of autocompletion values was above
+   // a certain limit - as happens in regular forms -
+   // but local autocompletion didn't always work,
+   // apparently due to page caching.
+   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
+   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
}
 
// The value has already been HTML-encoded as a parameter,

-- 
To view, visit https://gerrit.wikimedia.org/r/393518
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic44fac5ded23ebf4cc5511260d7c9ffe019fc6e0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits