<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://commons.islamical.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ASDC_tracking</id>
	<title>Module:SDC tracking - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://commons.islamical.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ASDC_tracking"/>
	<link rel="alternate" type="text/html" href="https://commons.islamical.org/w/index.php?title=Module:SDC_tracking&amp;action=history"/>
	<updated>2026-09-26T13:14:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://commons.islamical.org/w/index.php?title=Module:SDC_tracking&amp;diff=3956&amp;oldid=prev</id>
		<title>Mojtabakd: conditional wikibase fix</title>
		<link rel="alternate" type="text/html" href="https://commons.islamical.org/w/index.php?title=Module:SDC_tracking&amp;diff=3956&amp;oldid=prev"/>
		<updated>2026-09-25T08:25:47Z</updated>

		<summary type="html">&lt;p&gt;conditional wikibase fix&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:25, 25 September 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l33&quot;&gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local page  = mw.title.getCurrentTitle()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local page  = mw.title.getCurrentTitle()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(&lt;/del&gt;page.namespace == 6&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;) &lt;/del&gt;then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mw.wikibase then&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		&lt;/del&gt;args.entity = mw.wikibase.getEntity()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	    if &lt;/ins&gt;page.namespace == 6 then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	&lt;/del&gt;elseif args.item then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	        &lt;/ins&gt;args.entity = mw.wikibase.getEntity()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		&lt;/del&gt;args.entity = mw.wikibase.getEntity(args.item)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	    &lt;/ins&gt;elseif args.item then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end	&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	        &lt;/ins&gt;args.entity = mw.wikibase.getEntity(args.item)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	    end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	return args&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	return args&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mojtabakd</name></author>
	</entry>
	<entry>
		<id>https://commons.islamical.org/w/index.php?title=Module:SDC_tracking&amp;diff=3955&amp;oldid=prev</id>
		<title>Mojtabakd: creating module</title>
		<link rel="alternate" type="text/html" href="https://commons.islamical.org/w/index.php?title=Module:SDC_tracking&amp;diff=3955&amp;oldid=prev"/>
		<updated>2026-09-25T08:22:57Z</updated>

		<summary type="html">&lt;p&gt;creating module&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[  &lt;br /&gt;
  __  __           _       _        ____  ____   ____    _                  _    _             &lt;br /&gt;
 |  \/  | ___   __| |_   _| | ___ _/ ___||  _ \ / ___|  | |_ _ __ __ _  ___| | _(_)_ __   __ _ &lt;br /&gt;
 | |\/| |/ _ \ / _` | | | | |/ _ (_)___ \| | | | |      | __| &amp;#039;__/ _` |/ __| |/ / | &amp;#039;_ \ / _` |&lt;br /&gt;
 | |  | | (_) | (_| | |_| | |  __/_ ___) | |_| | |___   | |_| | | (_| | (__|   &amp;lt;| | | | | (_| |&lt;br /&gt;
 |_|  |_|\___/ \__,_|\__,_|_|\___(_)____/|____/ \____|___\__|_|  \__,_|\___|_|\_\_|_| |_|\__, |&lt;br /&gt;
                                                    |_____|                              |___/ &lt;br /&gt;
This module is intended to be the engine behind &amp;quot;Template:SDC_tracking&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Please do not modify this code without applying the changes first at&lt;br /&gt;
&amp;quot;Module:SDC_tracking/sandbox&amp;quot; and testing at &amp;quot;Module:SDC_tracking/testcases&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Authors and maintainers:&lt;br /&gt;
* User:Jarekt - original version &lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- =======================================&lt;br /&gt;
-- === Dependencies ======================&lt;br /&gt;
-- =======================================&lt;br /&gt;
require(&amp;#039;strict&amp;#039;) -- used for debugging purposes as it detects cases of unintended global variables&lt;br /&gt;
&lt;br /&gt;
-- =======================================&lt;br /&gt;
-- === Local Functions ===================&lt;br /&gt;
-- =======================================&lt;br /&gt;
&lt;br /&gt;
local function getArgs(frame)&lt;br /&gt;
	-- switch to lowercase parameters to make them case independent&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for name, value in pairs( frame.args ) do &lt;br /&gt;
		if value ~= &amp;#039;&amp;#039; then -- nuke empty strings&lt;br /&gt;
			args[string.lower(name)] = value&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local page  = mw.title.getCurrentTitle()&lt;br /&gt;
	&lt;br /&gt;
	if (page.namespace == 6) then&lt;br /&gt;
		args.entity = mw.wikibase.getEntity()&lt;br /&gt;
	elseif args.item then&lt;br /&gt;
		args.entity = mw.wikibase.getEntity(args.item)&lt;br /&gt;
	end	&lt;br /&gt;
	return args&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------&lt;br /&gt;
local function Category(catName)&lt;br /&gt;
	if catName then&lt;br /&gt;
		return &amp;#039;[[Category:&amp;#039; .. catName .. &amp;#039;]]&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- ==================================================&lt;br /&gt;
-- === External functions ===========================&lt;br /&gt;
-- ==================================================&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
-- === Version of the function to be called from other LUA codes&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
&lt;br /&gt;
function p._statement_exist(entity, property, positive, negative)&lt;br /&gt;
	-- check if statement exist&lt;br /&gt;
	if entity and entity.statements and entity.statements[property] then&lt;br /&gt;
		return positive&lt;br /&gt;
	else&lt;br /&gt;
		return negative&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------&lt;br /&gt;
function p._statement_has_value(entity, property, value, matching, mismatching, missing)&lt;br /&gt;
	value = value or &amp;#039;&amp;#039;&lt;br /&gt;
	if entity and entity.statements and entity.statements[property] then&lt;br /&gt;
		for _, statement in pairs( entity:getAllStatements( property )) do&lt;br /&gt;
			if (statement.mainsnak.snaktype == &amp;quot;value&amp;quot;) then &lt;br /&gt;
				local val = statement.mainsnak.datavalue.value&lt;br /&gt;
				if val.id then &lt;br /&gt;
					val = val.id&lt;br /&gt;
				elseif val.text then&lt;br /&gt;
					val = val.text&lt;br /&gt;
				end&lt;br /&gt;
				if val==value then&lt;br /&gt;
					return matching&lt;br /&gt;
				end				&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return mismatching&lt;br /&gt;
	else&lt;br /&gt;
		return missing&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
-- === Versions of the function to be called from template namespace&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
&lt;br /&gt;
function p.SDC_statement_exist(frame)&lt;br /&gt;
	local args   = getArgs(frame)&lt;br /&gt;
	&lt;br /&gt;
	-- skip if we are not in file namespace&lt;br /&gt;
	local page = mw.title.getCurrentTitle()&lt;br /&gt;
	if not (page.namespace==6 or page.namespace==args.namespace or args.namespace==&amp;#039;all&amp;#039;) then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end	&lt;br /&gt;
	&lt;br /&gt;
	local output = p._statement_exist(args.entity, args.property, args.positive_category, args.negative_category)&lt;br /&gt;
	return Category(output)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------&lt;br /&gt;
function p.SDC_statement_has_value (frame)&lt;br /&gt;
	local args   = getArgs(frame)&lt;br /&gt;
		&lt;br /&gt;
	-- skip if we are not in file namespace&lt;br /&gt;
	local page = mw.title.getCurrentTitle()&lt;br /&gt;
	if not (page.namespace==6 or page.namespace==args.namespace or args.namespace==&amp;#039;all&amp;#039;) then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end	&lt;br /&gt;
	&lt;br /&gt;
	local output = p._statement_has_value(args.entity, args.property, args.value, &lt;br /&gt;
					args.matching_category, args.mismatching_category, args.missing_category)&lt;br /&gt;
	return Category(output)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Mojtabakd</name></author>
	</entry>
</feed>