Popup message and Text customization issue after upgrade

I’ve just given this a run-through of my test site and I can repro this. I hadn’t updated my test site for a little while and on version f19044af6a it worked fine, but updating to latest 39be3cb619 gave the same behaviour as reported.

My step-by-step:

(Version f19044af6a)

  • Set default locale to ‘Español’
  • Set chat dm retention days to ‘30’
  • Go to /admin/customize/site_texts and edit js.chat.retention_reminders.dm
  • Refresh and check the message with a new test user:

Update to 39be3cb619

  • Existing message has raw parameter value:

  • Go to /admin/customize/site_texts and edit js.chat.retention_reminders.dm now gives an error 500 with this in the logs:

Message (4 copies reported)

NoMethodError (undefined method `scan' for {:one=>"Personal chat history is retained for %{count} day.", :other=>"Personal chat history is retained for %{count} days."}:Hash

    keys = text.scan(pattern)
               ^^^^^)
lib/i18n/i18n_interpolation_keys_finder.rb:6:in `find'
app/models/translation_override.rb:124:in `check_interpolation_keys'
app/models/translation_override.rb:65:in `upsert!'
app/controllers/admin/site_texts_controller.rb:88:in `update'
app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
app/controllers/application_controller.rb:414:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:369:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:228:in `call'

Backtrace

lib/i18n/i18n_interpolation_keys_finder.rb:6:in `find'
app/models/translation_override.rb:124:in `check_interpolation_keys'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:400:in `block in make_lambda'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:199:in `block (2 levels) in halting'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:687:in `block (2 levels) in default_terminator'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:686:in `catch'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:686:in `block in default_terminator'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:200:in `block in halting'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:595:in `block in invoke_before'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:595:in `each'

3 Likes