Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When pulling a category MediaWiki#list fails #93

Open
delonnewman opened this issue Apr 25, 2023 · 1 comment
Open

When pulling a category MediaWiki#list fails #93

delonnewman opened this issue Apr 25, 2023 · 1 comment

Comments

@delonnewman
Copy link
Contributor

When pulling the category as shown below:

Infoboxer.wikipedia('en').category('Category:Census-designated places in California')

I get the following error: 'block in list': undefined method 'first' for nil:NilClass (NoMethodError)

The stack trace points here:

.map { |raw| Page.new(self, Parser.paragraphs(raw['revisions'].first['*'], traits), raw) }

After doing some digging the issue seems to be that the page data for many of the pages listed in that category don't have a 'revisions' key, hence the error. I don't know enough about the MediaWiki APIs to propose a fix. But, I figured I'd start by reporting the issue here.

Thanks for your work!

Ruby Version: 3.0.4
Infoboxer Version: 0.4.0

delonnewman added a commit to delonnewman/infoboxer that referenced this issue Apr 25, 2023
delonnewman added a commit to delonnewman/infoboxer that referenced this issue Apr 25, 2023
Not the best fix since we'll be loosing data

(see molybdenum-99#93)
@zverok
Copy link
Contributor

zverok commented Apr 29, 2023

Thanks for the report, I'll try to look into it in the upcoming days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants