Page MenuHomePhabricator

Investigate wmgUseDualLicense
Closed, ResolvedPublic

Description

Nothing seems to use $wmgUseDualLicense, and all wikis are displaying the licensing of just CC BY SA...

   'wikidata-copyright' => 'All structured data from the main and property namespace is available under the <a href="https://creativecommons.org/publicdomain/zero/1.0/" title="Definition of the Creative Commons CC0 License">Creative Commons CC0 License</a>;
text in the other namespaces is available under the <a href="https://creativecommons.org/licenses/by-sa/3.0/" title="Definition of the Creative Commons Attribution/Share-Alike License">Creative Commons Attribution/Share-Alike License</a>;
additional terms may apply.
See <a href="https://wikimediafoundation.org/wiki/Terms_of_Use" title="Wikimedia Foundation Terms of Use">Terms of Use</a> for details.',
   'wikimedia-copyrightwarning' => 'By clicking the "{{int:savearticle}}" button, you agree to the [https://wikimediafoundation.org/wiki/Terms_of_Use Terms of Use], and you irrevocably agree to release your contribution under the [https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License CC BY-SA 3.0 License] and the [https://en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License GFDL].
You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.',

Version: wmf-deployment
Severity: major

Details

Reference
bz60023
Related Gerrit Patches:
operations/mediawiki-config : masterRemove wmgDualLicense, orphaned

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:52 AM
bzimport set Reference to bz60023.
bzimport added a subscriber: Unknown Object (MLST).
Reedy created this task.Jan 14 2014, 12:02 AM
'wikimedia-copyright' => 'Text is available under the <a href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution/Share-Alike License</a>;

additional terms may apply.
See <a href="https://wikimediafoundation.org/wiki/Terms_of_Use">Terms of Use</a> for details.',

Reedy added a comment.EditedJan 14 2014, 2:04 AM

(In reply to comment #0)

Nothing seems to use $wmgUseDualLicense, and all wikis are displaying the
licensing of just CC BY SA...

The only thing in InitialiseSettings.php that changes is the following:

'wgRightsUrl' => array(
	'default' => '//creativecommons.org/licenses/by-sa/3.0/',
	'huwikinews' => '//creativecommons.org/licenses/by/3.0/',
	'wikinews' => '//creativecommons.org/licenses/by/2.5/',
),
'wgRightsText' => array(
	'default' => 'Creative Commons Attribution-Share Alike 3.0',
	'huwikinews' => 'Creative Commons Attribution 3.0',
	'wikinews' => 'Creative Commons Attribution 2.5',
),
'wgRightsIcon' => array(
	'default' => '//creativecommons.org/images/public/somerights20.png',
),

Then in CommonSettings.php

// bug 44617
if ( in_array( $wgDBname, array( 'wikidatawiki', 'testwikidatawiki' ) ) ) {
	$wgHooks['SkinCopyrightFooter'][] = function( $title, $type, &$msg, &$link, &$forContent ) {
		if ( $title->getNamespace() === NS_MAIN ) {
			$msg = 'Creative Commons Public Domain 1.0';
			$link = '//creativecommons.org/publicdomain/zero/1.0/';
		}
		return true;
	};
}

The only place any of these are modified further is in the WikimediaMessages extension. The code is/was a little hard to follow in it's current format. I've made it a bit simpler to read by putting things where they are used in https://gerrit.wikimedia.org/r/107281 and a bit more simplification in https://gerrit.wikimedia.org/r/107284

The code currently is now as such, it modifies the Skin Copyright Footer for all wikis bar huwikinews and any of the other wikinews projects (see $wgRightsUrl above)

	if( strpos( $wgRightsUrl, 'creativecommons.org/licenses/by-sa/3.0' ) !== false ) {
		// Override with Wikimedia's site-specific copyright message defaults
		// with the CC/GFDL semi-dual license fun!

		/**
		 * @param $title Title
		 * @param $type string
		 * @param $msg string
		 * @param $link
		 * @param $forContent bool
		 * @return bool
		 */
		$wgHooks['SkinCopyrightFooter'][] = function( $title, $type, &$msg, &$link, &$forContent ) {
			if( $type != 'history' ) {
				global $wgDBname;
				if ( in_array( $wgDBname, array( 'wikidatawiki', 'testwikidatawiki' ) ) ) {
					$msg = 'wikidata-copyright';
				} else {
					$msg = 'wikimedia-copyright'; // the default;
				}
				$forContent = false;
			}

			return true;
		};

		$wgHooks['EditPageCopyrightWarning'][] = function( $title, &$msg ) {
			$msg = array( 'wikimedia-copyrightwarning' );
			return true;
		};
	}

wikimedia-copyright doesn't mention GFDL, but 'wikimedia-copyrightwarning' does. Neither of which respect $wmgUseDualLicense

The Wikidata messages are fine, though, should probably be collapsed down to one set of config on the SkinCopyrightFooter hook.

For the variance, the current 'wikimedia-copyright' and 'wikimedia-copyrightwarning' need normalising, and then a dual variant adding (or a singular depending on how current ones are changed)

Config then updated to be something like

	if( strpos( $wgRightsUrl, 'creativecommons.org/licenses/by-sa/3.0' ) !== false ) {
		// Override with Wikimedia's site-specific copyright message defaults
		// with the CC/GFDL semi-dual license fun!

		/**
		 * @param $title Title
		 * @param $type string
		 * @param $msg string
		 * @param $link
		 * @param $forContent bool
		 * @return bool
		 */
		$wgHooks['SkinCopyrightFooter'][] = function( $title, $type, &$msg, &$link, &$forContent ) {
			if( $type != 'history' ) {
				global $wgDBname, $wmgUseDualLicense;
				if ( in_array( $wgDBname, array( 'wikidatawiki', 'testwikidatawiki' ) ) ) {
					$msg = 'wikidata-copyright';
				} elseif ( $wmgUseDualLicense ) {
					$msg = array( 'wikimedia-copyright-dual' );
				} else {
					$msg = array( 'wikimedia-copyright' );
				}
				$forContent = false;
			}

			return true;
		};

		$wgHooks['EditPageCopyrightWarning'][] = function( $title, &$msg ) {
			global $wmgUseDualLicense;
			if ( $wmgUseDualLicense ) {
				$msg = array( 'wikimedia-copyrightwarning-dual' );
			} else {
				$msg = array( 'wikimedia-copyrightwarning' );
			}
			return true;
		};
	}
greg added a comment.May 13 2014, 6:09 PM

What's left?

Reedy: What's left here?

Reedy: What's left here?

Reedy: What's left here? Last call.

Krenair changed the task status from Open to Stalled.Feb 14 2015, 3:57 AM
Krenair added a subscriber: Krenair.
Aklapper closed this task as Resolved.Mar 10 2015, 2:45 PM
Aklapper claimed this task.
Aklapper added a subscriber: Aklapper.

No reply by Reedy; assuming this is fully resolved.

Change 209840 had a related patch set uploaded (by Alex Monk):
Remove wmgDualLicense, orphaned

https://gerrit.wikimedia.org/r/209840

Krenair renamed this task from Wikimedia wikis are displaying the incorrect license information to Investigate wmgUseDualLicense.Jun 11 2015, 3:57 PM
Krenair reopened this task as Open.
Krenair set Security to None.
Aklapper reassigned this task from Aklapper to Krenair.Jun 11 2015, 11:47 PM
Krenair reassigned this task from Krenair to Reedy.Jun 11 2015, 11:58 PM
Reedy updated the task description. (Show Details)Jun 28 2015, 5:05 PM

Change 209840 merged by jenkins-bot:
Remove wmgDualLicense, orphaned

https://gerrit.wikimedia.org/r/209840

Krenair closed this task as Resolved.Jul 15 2015, 11:24 PM

Gone