Thread:Extension talk:Cite/LUA Error With Cite/reply (8)

That didn't come out correctly. Here is the correct version.

--Wikidata fallback if requested --   local item = mw.wikibase.getEntity --   if item ~= nil and item.claims ~= nil then --      for _, params in pairs( conf ) do  --           if params[3] ~= 0 then --              local val = parentArgs[params[1]] --                     local canUseWikidata = nil --              if not val or val == '' then --                   if reqs[params[1]] ~= nil then --                       canUseWikidata = matchesWikidataRequirements( item, reqs[params[1]] ) --                   else --                       canUseWikidata = true --                   end --                   if canUseWikidata then --                       local wikidataIds = getIdsFromWikidata( item, 'p' .. params[3] ) --                       if wikidataIds[1] then --                          parentArgs[params[1]] = wikidataIds[1] --                      end --                   end --               end --           end --       end --   end