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

internal server error when saving configuration with order_schedule #801

Closed
JuliusR opened this issue Jan 17, 2021 · 2 comments
Closed

internal server error when saving configuration with order_schedule #801

JuliusR opened this issue Jan 17, 2021 · 2 comments
Labels
Milestone

Comments

@JuliusR
Copy link
Contributor

JuliusR commented Jan 17, 2021

Saving the admin config (PATCH "/demo/admin/config") fails with an internal server error if order_schedule is used.

NoMethodError (undefined method `to_ical' for #<ActionController::Parameters:0x00007f8d38fdbde0>):
app/controllers/admin/configs_controller.rb:48:in `block in parse_recurring_selects!'
app/controllers/admin/configs_controller.rb:43:in `each'
app/controllers/admin/configs_controller.rb:43:in `parse_recurring_selects!'
app/controllers/admin/configs_controller.rb:18:in `update'
app/controllers/application_controller.rb:94:in `set_currency'
app/controllers/application_controller.rb:82:in `set_time_zone'

This can be reproduced with the demo. Here are the parameters that cause the failure:

{
  # [omitting irrelevant params]
  'config' => {
    # [omitting irrelevant options]
    'order_schedule' => {
      'boxfill' => { 'recurr' => 'null', 'time' => '' },
      'ends' => {
        'recurr' =>
          "{\"interval\":1,\"until\":null,\"count\":null,\"validations\":null,\"rule_type\":\"IceCube::DailyRule\"}",
        'time' => '10',
      },
    },
  },
}

With the following parameters, saving the new configuration succeeds.

{
  # [omitting irrelevant params]
  'config' => {
    # [omitting irrelevant options]
    'order_schedule' => {
      'boxfill' => { 'recurr' => 'null', 'time' => '' },
      'ends' => { 'recurr' => '{}', 'time' => '10' },
    },
  },
}
@JuliusR JuliusR added the bug label Jan 17, 2021
@JuliusR JuliusR added this to the 4.7.2 milestone Jan 17, 2021
@JuliusR
Copy link
Contributor Author

JuliusR commented Jan 17, 2021

According to a user report, this problems has been there for a while already. It is unfortunate that the error reporting is broken. Does anyone know how to fix foodcoops/foodcoops.net#35?

@yksflip yksflip modified the milestones: 4.8.1, 4.8.2 Jan 26, 2024
mortbauer added a commit to mortbauer/foodsoft that referenced this issue Feb 15, 2024
@mortbauer
Copy link
Contributor

Hey @yksflip, I'm trying to get your current master branch to our foodcoopsat site and stumbled over this bug which I was able to resolve within pull #1042.

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

Successfully merging a pull request may close this issue.

3 participants