Some sessions/availabilities cannot be edited, throw error
After scrutiny on several sessions and why this happens, this seems now to be filtered down to https://scriptum.degrowth.net/en/malmo2018/events/542 and the participation of person 1067.
- we cannot set the availability of this person for that day (but we managed to set his availability for all other days, then no error is thrown)
- we cannot change the time slot or rooms of this or any other conflicting event
- we cannot set the availability of any person associated with this or any other conflicting event
While opening the mentioned event, the following error is thrown:
D, [2018-08-16T22:56:21.644216 #8] DEBUG -- : Person Load (0.3ms) SELECT "people".* FROM "people" WHERE "people"."user_id" = $1 LIMIT 1 [["user_id", 5]]
I, [2018-08-16T22:56:21.645205 #8] INFO -- : Rendered shared/_flash.html.haml (0.1ms)
I, [2018-08-16T22:56:21.645570 #8] INFO -- : Completed 200 OK in 53ms (Views: 38.8ms | ActiveRecord: 7.6ms)
I, [2018-08-16T22:56:21.898376 #8] INFO -- : Started GET "/assets/images/ui-bg_glass_75_ffffff_1x400.png" for 46.81.159.140 at 2018-08-16 22:56:21 +0000
F, [2018-08-16T22:56:21.900597 #8] FATAL -- :
ActionController::RoutingError (No route matches [GET] "/assets/images/ui-bg_glass_75_ffffff_1x400.png"):
actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
request_store (1.2.0) lib/request_store/middleware.rb:8:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/static.rb:116:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.4) lib/rails/engine.rb:518:in `call'
railties (4.2.4) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
puma (2.14.0) lib/puma/server.rb:541:in `handle_request'
puma (2.14.0) lib/puma/server.rb:388:in `process_client'
puma (2.14.0) lib/puma/server.rb:270:in `block in run'
puma (2.14.0) lib/puma/thread_pool.rb:106:in `call'
puma (2.14.0) lib/puma/thread_pool.rb:106:in `block in spawn_thread'
Setting the availability of the mentioned user for day 23 (and similar for any of the related users):
D, [2018-08-16T22:57:52.500084 #8] DEBUG -- : Event Load (1.1ms) SELECT DISTINCT "events".* FROM "events" INNER JOIN "event_people" ON "events"."id" = "event_people"."event_id" WHERE "event_people"."person_id" = $1 AND "events"."conference_id" = $2 [["person_id", 1067], ["conference_id", 2]]
D, [2018-08-16T22:57:52.502448 #8] DEBUG -- : Day Load (0.3ms) SELECT "days".* FROM "days" WHERE "days"."id" = $1 ORDER BY "days"."start_date" ASC LIMIT 1 [["id", 9]]
D, [2018-08-16T22:57:52.503966 #8] DEBUG -- : SQL (0.3ms) DELETE FROM "conflicts" WHERE "conflicts"."event_id" = $1 [["event_id", 542]]
D, [2018-08-16T22:57:52.505102 #8] DEBUG -- : SQL (0.4ms) DELETE FROM "conflicts" WHERE "conflicts"."conflicting_event_id" = $1 [["conflicting_event_id", 542]]
D, [2018-08-16T22:57:52.506606 #8] DEBUG -- : Room Load (0.3ms) SELECT "rooms".* FROM "rooms" WHERE "rooms"."id" = $1 ORDER BY "rooms"."rank" ASC LIMIT 1 [["id", 28]]
D, [2018-08-16T22:57:52.509061 #8] DEBUG -- : Event Load (0.7ms) SELECT "events".* FROM "events" WHERE "events"."state" IN ('confirmed', 'unconfirmed', 'paid') AND ("events"."start_time" >= '2018-08-23 12:30:00.000000') AND ("events"."start_time" < '2018-08-23 14:00:00.000000') AND ("events"."id" != $1) AND ("events"."room_id" != $2) [["id", 542], ["room_id", 28]]
D, [2018-08-16T22:57:52.511426 #8] DEBUG -- : Event Load (0.8ms) SELECT "events".* FROM "events" WHERE "events"."state" IN ('confirmed', 'unconfirmed', 'paid') AND "events"."room_id" = $1 AND ("events"."start_time" >= '2018-08-22 22:00:00.000000') AND ("events"."start_time" <= '2018-08-23 21:59:59.999999') AND ("events"."id" != 542) [["room_id", 28]]
D, [2018-08-16T22:57:52.513247 #8] DEBUG -- : Conference Load (0.3ms) SELECT "conferences".* FROM "conferences" WHERE "conferences"."id" = $1 LIMIT 1 [["id", 2]]
D, [2018-08-16T22:57:52.514112 #8] DEBUG -- : CACHE (0.0ms) SELECT "conferences".* FROM "conferences" WHERE "conferences"."id" = $1 LIMIT 1 [["id", 2]]
D, [2018-08-16T22:57:52.514877 #8] DEBUG -- : (0.2ms) ROLLBACK
D, [2018-08-16T22:57:52.516513 #8] DEBUG -- : PaperTrail::Version Load (0.3ms) SELECT "versions".* FROM "versions" WHERE "versions"."item_id" = $1 AND "versions"."item_type" = $2 ORDER BY "versions"."created_at" ASC, "versions"."id" ASC [["item_id", 1067], ["item_type", "Person"]]
I, [2018-08-16T22:57:52.517184 #8] INFO -- : Completed 500 Internal Server Error in 43ms (ActiveRecord: 7.6ms)
F, [2018-08-16T22:57:52.518881 #8] FATAL -- :
NoMethodError (undefined method `*' for nil:NilClass):
app/models/event.rb:196:in `end_time'
app/models/event.rb:362:in `overlap?'
app/models/event.rb:601:in `block in update_event_conflicts'
app/models/event.rb:600:in `update_event_conflicts'
app/models/event.rb:382:in `update_conflicts'
app/models/availability.rb:40:in `block in update_event_conflicts'
app/models/availability.rb:39:in `update_event_conflicts'
app/models/person.rb:226:in `update_attributes_from_slider_form'
app/controllers/availabilities_controller.rb:16:in `update'