[Wikidata-bugs] [Maniphest] [Commented On] T222606: Create Maintenance Script to Remove Terms in a Language from Current Revision
gerritbot added a comment. Change 529062 **merged** by jenkins-bot: [mediawiki/extensions/Wikibase@master] Move RemoveTermsInLanguage.php to removeTermsInLanguage.php https://gerrit.wikimedia.org/r/529062 TASK DETAIL https://phabricator.wikimedia.org/T222606 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Rosalie_WMDE, gerritbot Cc: Ladsgroup, Lydia_Pintscher, Aklapper, Addshore, Tarrow, Hook696, Daryl-TTMG, RomaAmorRoma, 0010318400, E.S.A-Sheild, darthmon_wmde, alaa_wmde, joker88john, DannyS712, CucyNoiD, Nandana, NebulousIris, Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Af420, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, WSH1906, Lewizho99, Maathavan, _jensen, rosalieper, Jonas, Wikidata-bugs, aude, Mbch331 ___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
[Wikidata-bugs] [Maniphest] [Commented On] T222606: Create Maintenance Script to Remove Terms in a Language from Current Revision
gerritbot added a comment. Change 527111 **merged** by jenkins-bot: [mediawiki/extensions/Wikibase@master] Add maintenance script to remove Terms in a language from current revision https://gerrit.wikimedia.org/r/527111 TASK DETAIL https://phabricator.wikimedia.org/T222606 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Rosalie_WMDE, gerritbot Cc: Ladsgroup, Lydia_Pintscher, Aklapper, Addshore, Tarrow, Hook696, Daryl-TTMG, RomaAmorRoma, 0010318400, E.S.A-Sheild, darthmon_wmde, alaa_wmde, joker88john, DannyS712, CucyNoiD, Nandana, NebulousIris, Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Af420, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, WSH1906, Lewizho99, Maathavan, _jensen, rosalieper, Jonas, Wikidata-bugs, aude, Mbch331 ___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
[Wikidata-bugs] [Maniphest] [Commented On] T222606: Create Maintenance Script to Remove Terms in a Language from Current Revision
gerritbot added a comment. Change 529062 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup): [mediawiki/extensions/Wikibase@master] Move RemoveTermsInLanguage.php to removeTermsInLanguage.php https://gerrit.wikimedia.org/r/529062 TASK DETAIL https://phabricator.wikimedia.org/T222606 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Rosalie_WMDE, gerritbot Cc: Ladsgroup, Lydia_Pintscher, Aklapper, Addshore, Tarrow, Hook696, Daryl-TTMG, RomaAmorRoma, 0010318400, E.S.A-Sheild, darthmon_wmde, alaa_wmde, joker88john, DannyS712, CucyNoiD, Nandana, NebulousIris, Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Af420, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, WSH1906, Lewizho99, Maathavan, _jensen, rosalieper, Jonas, Wikidata-bugs, aude, Mbch331 ___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
[Wikidata-bugs] [Maniphest] [Commented On] T222606: Create Maintenance Script to Remove Terms in a Language from Current Revision
gerritbot added a comment. Change 527111 had a related patch set uploaded (by Rosalie Perside (WMDE); owner: Rosalie Perside (WMDE)): [mediawiki/extensions/Wikibase@master] Add maintenance script to remove Terms in a language from current revision https://gerrit.wikimedia.org/r/527111 TASK DETAIL https://phabricator.wikimedia.org/T222606 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Rosalie_WMDE, gerritbot Cc: Ladsgroup, Lydia_Pintscher, Aklapper, Addshore, Tarrow, darthmon_wmde, alaa_wmde, DannyS712, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Jonas, Wikidata-bugs, aude, Mbch331 ___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
[Wikidata-bugs] [Maniphest] [Commented On] T222606: Create Maintenance Script to Remove Terms in a Language from Current Revision
Ladsgroup added a comment. I wrote a basic maintaince script and ran it in production and worked fine: name=compactTermsRemover.php addDescription( "Removes terms in the given language in the given entities."); $this->addOption( 'entity-id', 'Id of the entity', true, true ); $this->addOption( 'language', 'Language to remove', true, true ); } public function execute() { if ( !WikibaseSettings::isRepoEnabled() ) { $this->error( "You need to have Wikibase enabled in order to use this maintenance script!\n", 1 ); } $repo = WikibaseRepo::getDefaultInstance(); $idSerialization = $this->getOption( 'entity-id' ); $language = $this->getOption( 'language' ); try { $entityId = $repo->getEntityIdParser()->parse( $idSerialization ); } catch ( InvalidArgumentException $e ) { $this->error( "Invalid property id: " . $idSerialization, 1 ); } $entityRevisionLookup = $repo->getEntityRevisionLookup(); $entityStore = $repo->getEntityStore(); $entityRevision = $entityRevisionLookup->getEntityRevision( $entityId, 0, EntityRevisionLookup::LATEST_FROM_MASTER ); if ( $entityRevision === null ) { throw new StorageException( "Could not load entity: " . $entityId->getSerialization() ); } $entity = $entityRevision->getEntity(); if ( $entity instanceof LabelsProvider ) { $entity->getLabels()->removeByLanguage( $language ); } if ( $entity instanceof DescriptionsProvider ) { $entity->getDescriptions()->removeByLanguage( $language ); } if ( $entity instanceof AliasesProvider ) { $entity->getAliasGroups()->removeByLanguage( $language ); } $entityStore->saveEntity( $entity, 'Removed terms in language ' . $language, User::newFromName( 'Maintenance script' ), EDIT_UPDATE, $entityRevision->getRevisionId() ); $this->output( "Successfully removed terms in language $language from $idSerialization.\n" ); } } $maintClass = RemoveTermsInLanguages::class; require_once RUN_MAINTENANCE_IF_MAIN; TASK DETAIL https://phabricator.wikimedia.org/T222606 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Ladsgroup Cc: Ladsgroup, Lydia_Pintscher, Aklapper, Addshore, Tarrow, darthmon_wmde, alaa_wmde, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Jonas, Wikidata-bugs, aude, Mbch331 ___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs