Merge pull request #1968 from OpenRefine/wikidata_summary_fix

Increment editgroups hash size for 3.2, fix comma issue in summaries
This commit is contained in:
Antonin Delpeuch 2019-02-27 08:56:12 +00:00 committed by GitHub
commit bfec5ea2cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,8 +169,13 @@ public class PerformWikibaseEditsOperation extends EngineDependentOperation {
// Generate batch token
long token = (new Random()).nextLong();
String summary = _summary + String.format(" ([[:toollabs:editgroups/b/OR/%s|details]])",
(Long.toHexString(token).substring(0, 8)));
// The following replacement is a fix for: https://github.com/Wikidata/editgroups/issues/4
// Because commas and colons are used by Wikibase to separate the auto-generated summaries
// from the user-supplied ones, we replace these separators by similar unicode characters to
// make sure they can be told apart.
String summaryWithoutCommas = _summary.replaceAll(", "," ").replaceAll(": ","։ ");
String summary = summaryWithoutCommas + String.format(" ([[:toollabs:editgroups/b/OR/%s|details]])",
(Long.toHexString(token).substring(0, 9)));
// Evaluate the schema
List<ItemUpdate> itemDocuments = _schema.evaluate(_project, _engine);