smpallen99 / contact_demo

A second ExAdmin Demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drag and Drop sort on categories exception

smpallen99 opened this issue · comments

Drag and drop a category to change the sort order and get the following exception:

[info] module=Plug.Logger line=27 function=call/2 POST /admin/categories/sort
[debug] module=Phoenix.Logger line=25 function=phoenix_controller_call/3 Processing by ExAdmin.AdminController.sort/2
  Parameters: %{"ids" => ["1", "3", "2", "4", "5"], "resource" => "categories"}
  Pipelines: [:browser]
[info] module=Plug.Logger line=34 function=call/2 Sent 500 in 20ms
[error] #PID<0.1399.0> running ContactDemo.Endpoint terminated
Server: localhost:4001 (http)
Request: POST /admin/categories/sort
** (exit) an exception was raised:
    ** (UndefinedFunctionError) function ExAdmin.AdminController.sort/2 is undefined or private
        ExAdmin.AdminController.sort(%Plug.Conn{adapter: {Plug.Adapters.Cowboy.Conn, :...}, assigns: %{current_user: %ContactDemo.User{__meta__: #Ecto.Schema.Metadata<:loaded, "users">, active: true, confirmation_send_at: nil, confirmation_token: nil, confirmed_at: #Ecto.DateTime<2016-11-21 02:35:52>, current_sign_in_at: #Ecto.DateTime<2016-11-21 02:42:56>, current_sign_in_ip: "{127, 0, 0, 1}", email: "demouser@example.com", encrypted_password: "$2b$12$aT/rKP1qcUSkXAB91dAKVu9FzrD0LAWvLON2MSOI1j/Bk69CHQVay", expire_on: nil, failed_attempts: 0, id: 1, inserted_at: #Ecto.DateTime<2016-11-21 02:35:52>, last_sign_in_at: #Ecto.DateTime<2016-11-21 02:39:00>, last_sign_in_ip: "{127, 0, 0, 1}", locked_at: nil, name: "Demo User", password: nil, password_confirmation: nil, remember_created_at: nil, reset_password_sent_at: nil, reset_password_token: nil, roles: #Ecto.Association.NotLoaded<association :roles is not loaded>, sign_in_count: 3, unlock_token: nil, updated_at: #Ecto.DateTime<2016-11-21 02:42:56>, username: "demouser", users_roles: #Ecto.Association.NotLoaded<association :users_roles is not loaded>}, theme: ExAdmin.Theme.AdminLte2}, before_send: [#Function<0.78035410/1 in Plug.CSRFProtection.call/2>, #Function<4.45355785/1 in Phoenix.Controller.fetch_flash/2>, #Function<0.74176132/1 in Plug.Session.before_send/2>, #Function<1.86316214/1 in Plug.Logger.call/2>, #Function<0.6223796/1 in Phoenix.LiveReloader.before_send_inject_reloader/1>], body_params: %{"ids" => ["1", "3", "2", "4", "5"]}, cookies: %{"_admin2_key" => "g3QAAAABbQAAAAtfY3NyZl90b2tlbm0AAAAYNEJlUmsyVTJ1NGdFc0VWMTVyOVA3UT09##HSrLNw6V_EVXIX-F4cagBQk1ng0=", "_nested_key" => "SFMyNTY.g3QAAAADbQAAAAtfY3NyZl90b2tlbm0AAAAYeGI4ZnNTcmJIcFlrcEQ5RTZRQjg4Zz09bQAAAAxzZXNzaW9uX2F1dGhtAAAAJGNjNzFmZjIyLWFmOTQtMTFlNi1hZDFlLTYwMDMwODhlNzViY20AAAAOdXNlcl9yZXR1cm5fdG9kAANuaWw.Mq8wCxFHuo26vGcRrlHexBOGKNuq_ijt1JzZqpER8X8"}, halted: false, host: "localhost", method: "POST", owner: #PID<0.1399.0>, params: %{"ids" => ["1", "3", "2", "4", "5"], "resource" => "categories"}, path_info: ["admin", "categories", "sort"], peer: {{127, 0, 0, 1}, 56097}, port: 4001, private: %{ContactDemo.Router => {[], %{}}, :phoenix_action => :sort, :phoenix_controller => ExAdmin.AdminController, :phoenix_endpoint => ContactDemo.Endpoint, :phoenix_flash => %{}, :phoenix_format => "html", :phoenix_layout => {ExAdmin.LayoutView, "admin_lte2.html"}, :phoenix_pipelines => [:browser], :phoenix_route => #Function<56.99136698/1 in ContactDemo.Router.match_route/4>, :phoenix_router => ContactDemo.Router, :phoenix_view => ExAdmin.AdminView, :plug_session => %{"_csrf_token" => "xb8fsSrbHpYkpD9E6QB88g==", "session_auth" => "cc71ff22-af94-11e6-ad1e-6003088e75bc", "user_return_to" => nil}, :plug_session_fetch => :done}, query_params: %{}, query_string: "", remote_ip: {127, 0, 0, 1}, req_cookies: %{"_admin2_key" => "g3QAAAABbQAAAAtfY3NyZl90b2tlbm0AAAAYNEJlUmsyVTJ1NGdFc0VWMTVyOVA3UT09##HSrLNw6V_EVXIX-F4cagBQk1ng0=", "_nested_key" => "SFMyNTY.g3QAAAADbQAAAAtfY3NyZl90b2tlbm0AAAAYeGI4ZnNTcmJIcFlrcEQ5RTZRQjg4Zz09bQAAAAxzZXNzaW9uX2F1dGhtAAAAJGNjNzFmZjIyLWFmOTQtMTFlNi1hZDFlLTYwMDMwODhlNzViY20AAAAOdXNlcl9yZXR1cm5fdG9kAANuaWw.Mq8wCxFHuo26vGcRrlHexBOGKNuq_ijt1JzZqpER8X8"}, req_headers: [{"host", "localhost:4001"}, {"connection", "keep-alive"}, {"content-length", "59"}, {"accept", "*/*"}, {"origin", "http://localhost:4001"}, {"x-csrf-token", "EjBzMQIQMTgtNDA7JQoOB2MQd05yAAAAjRKWqCCZeDiPUN7BUA5vJg=="}, {"x-requested-with", "XMLHttpRequest"}, {"user-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"}, {"content-type", "application/x-www-form-urlencoded; charset=UTF-8"}, {"referer", "http://localhost:4001/admin/categories"}, {"accept-encoding", "gzip, deflate, br"}, {"accept-language", "en-US,en;q=0.8"}, {"cookie", "_admin2_key=g3QAAAABbQAAAAtfY3NyZl90b2tlbm0AAAAYNEJlUmsyVTJ1NGdFc0VWMTVyOVA3UT09##HSrLNw6V_EVXIX-F4cagBQk1ng0=; _nested_key=SFMyNTY.g3QAAAADbQAAAAtfY3NyZl90b2tlbm0AAAAYeGI4ZnNTcmJIcFlrcEQ5RTZRQjg4Zz09bQAAAAxzZXNzaW9uX2F1dGhtAAAAJGNjNzFmZjIyLWFmOTQtMTFlNi1hZDFlLTYwMDMwODhlNzViY20AAAAOdXNlcl9yZXR1cm5fdG9kAANuaWw.Mq8wCxFHuo26vGcRrlHexBOGKNuq_ijt1JzZqpER8X8"}], request_path: "/admin/categories/sort", resp_body: nil, resp_cookies: %{}, resp_headers: [{"cache-control", "max-age=0, private, must-revalidate"}, {"x-request-id", "i7du90jpsvmp0ejvppor7ckd0hsuhgqo"}, {"x-frame-options", "SAMEORIGIN"}, {"x-xss-protection", "1; mode=block"}, {"x-content-type-options", "nosniff"}], scheme: :http, script_name: [], secret_key_base: "m3g6ltbv+hunhzFPWAfLWNaGIxoUn7KirHwPyYl6NSP44qOQfaMAj+RgR/Fr1JJS", state: :unset, status: nil}, %{"ids" => ["1", "3", "2", "4", "5"], "resource" => "categories"})
        web/controllers/admin_controller.ex:1: ExAdmin.AdminController.action/2
        web/controllers/admin_controller.ex:1: ExAdmin.AdminController.phoenix_controller_pipeline/2
        (contact_demo) lib/contact_demo/endpoint.ex:1: ContactDemo.Endpoint.instrument/4
        (contact_demo) lib/phoenix/router.ex:261: ContactDemo.Router.dispatch/2
        (contact_demo) web/router.ex:1: ContactDemo.Router.do_call/2
        (contact_demo) lib/contact_demo/endpoint.ex:1: ContactDemo.Endpoint.phoenix_pipeline/1
        (contact_demo) lib/plug/debugger.ex:123: ContactDemo.Endpoint."call (overridable 3)"/2
        (contact_demo) lib/contact_demo/endpoint.ex:1: ContactDemo.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4