From 9ff138c65d1e0d541aa76581011b63e599b9aee1 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Mon, 3 Feb 2020 11:21:03 +0100 Subject: [PATCH] Apply tags directly through the Wikibase API, fixes #2196 --- .../wikidata/operations/PerformWikibaseEditsOperation.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/wikidata/src/org/openrefine/wikidata/operations/PerformWikibaseEditsOperation.java b/extensions/wikidata/src/org/openrefine/wikidata/operations/PerformWikibaseEditsOperation.java index 041724735..864b4e6c4 100644 --- a/extensions/wikidata/src/org/openrefine/wikidata/operations/PerformWikibaseEditsOperation.java +++ b/extensions/wikidata/src/org/openrefine/wikidata/operations/PerformWikibaseEditsOperation.java @@ -158,15 +158,13 @@ public class PerformWikibaseEditsOperation extends EngineDependentOperation { this._engine = engine; this._schema = (WikibaseSchema) project.overlayModels.get("wikibaseSchema"); this._summary = summary; - // TODO this is one of the attributes that should be configured on a per-wiki basis - // TODO enable this tag once 3.3 final is released and create 3.4 tag without AbuseFilter String tag = "openrefine"; Pattern pattern = Pattern.compile("^(\\d+\\.\\d+).*$"); Matcher matcher = pattern.matcher(RefineServlet.VERSION); if (matcher.matches()) { tag += "-"+matcher.group(1); } - this._tags = Collections.emptyList(); // TODO Arrays.asList(tag); + this._tags = Arrays.asList(tag); this._historyEntryID = HistoryEntry.allocateID(); } @@ -191,7 +189,7 @@ public class PerformWikibaseEditsOperation extends EngineDependentOperation { // 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, 10))); + (Long.toHexString(token).substring(0, 11))); // Evaluate the schema List itemDocuments = _schema.evaluate(_project, _engine);