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

[ERROR] public_body#list (TypeError) "no implicit conversion of false into Integer" #5874

Closed
garethrees opened this issue Aug 20, 2020 · 6 comments
Labels
bug Breaks expected functionality f:authorities x:uk

Comments

@garethrees
Copy link
Member

A TypeError occurred in public_body#list:

no implicit conversion of false into Integer
app/controllers/public_body_controller.rb:120:in `upcase'


-------------------------------
Request:
-------------------------------

* URL : https://www.whatdotheyknow.com/cy/body/list/m?page=5
* HTTP Method: GET
* Parameters : {"page"=>"5", "controller"=>"public_body", "action"=>"list", "tag"=>"m", "locale"=>"cy"}
* Timestamp : 2020-08-19 10:10:45 +0100
* Server : owl
* Rails root : /data/vhost/www.whatdotheyknow.com/alaveteli-2020-08-14T14-54-29
* Process: 6960

-------------------------------
Session:
-------------------------------

* session id: [FILTERED]
* data: {"session_id"=>"30b86bcae4fad173cf9e6a1825efc3f6", "locale"=>"cy"}

-------------------------------
Backtrace:
-------------------------------

app/controllers/public_body_controller.rb:120:in `upcase'
app/controllers/public_body_controller.rb:120:in `list'
app/controllers/application_controller.rb:111:in `record_memory'
lib/strip_empty_sessions.rb:15:in `call'
@garethrees garethrees added x:uk bug Breaks expected functionality f:authorities labels Aug 20, 2020
@garethrees
Copy link
Member Author

garethrees commented Aug 27, 2020

# Passing false to upcase as the exception suggests is happening:
Unicode.upcase(false)
# => TypeError: wrong argument type false (expected String)

# Maybe its something else on the same line? Nope…
@tag = false
Unicode.upcase(@tag) if @tag.scan(/./mu).size == 1
# => NoMethodError: undefined method `scan' for false:FalseClass

@garethrees
Copy link
Member Author

I think #5871 might be the underlying cause of this one.

mysociety-pusher pushed a commit that referenced this issue Aug 27, 2020
There seems to be an issue with `MySociety::Format.simplify_url_part`
but we're not getting a full stack trace due to the source being outside
of app/lib.

This change should hopefully give us more information to allow us to
debug this issue.

See:
  #5870
  #5871
  #5873
  #5874
  #5876
  #5877
  #5878
  #5879
mysociety-pusher pushed a commit that referenced this issue Aug 30, 2020
There seems to be an issue with `MySociety::Format.simplify_url_part`
but we're not getting a full stack trace due to the source being outside
of app/lib.

This change should hopefully give us more information to allow us to
debug this issue.

See:
  #5870
  #5871
  #5873
  #5874
  #5876
  #5877
  #5878
  #5879
@garethrees
Copy link
Member Author

Backtrace after cdccd2a

-------------------------------
Backtrace:
-------------------------------

  app/controllers/public_body_controller.rb:120:in `upcase'
  app/controllers/public_body_controller.rb:120:in `list'
  app/controllers/application_controller.rb:111:in `record_memory'
  lib/strip_empty_sessions.rb:15:in `call'

@gbp
Copy link
Member

gbp commented Sep 4, 2020

Out of the other similar issues, I think this is the only one which might need more work to replace calls (1 2 3) to Unicode.upcase. The Unicode gem can then be removed

@garethrees
Copy link
Member Author

Nice!

mysociety-pusher pushed a commit that referenced this issue Sep 10, 2020
There seems to be an issue with `MySociety::Format.simplify_url_part`
but we're not getting a full stack trace due to the source being outside
of app/lib.

This change should hopefully give us more information to allow us to
debug this issue.

See:
  #5870
  #5871
  #5873
  #5874
  #5876
  #5877
  #5878
  #5879
@gbp
Copy link
Member

gbp commented Oct 15, 2020

Closing after #5907

@gbp gbp closed this as completed Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Breaks expected functionality f:authorities x:uk
Projects
None yet
Development

No branches or pull requests

2 participants