{"action":"created","issue":{"url":"https://api.github.com/repos/zotonic/zotonic/issues/1330","repository_url":"https://api.github.com/repos/zotonic/zotonic","labels_url":"https://api.github.com/repos/zotonic/zotonic/issues/1330/labels{/name}","comments_url":"https://api.github.com/repos/zotonic/zotonic/issues/1330/comments","events_url":"https://api.github.com/repos/zotonic/zotonic/issues/1330/events","html_url":"https://github.com/zotonic/zotonic/issues/1330","id":162725707,"number":1330,"title":"Unable to update a resource with a new property using a list as its name","user":{"login":"Dirklectisch","id":542192,"avatar_url":"https://avatars.githubusercontent.com/u/542192?v=3","gravatar_id":"","url":"https://api.github.com/users/Dirklectisch","html_url":"https://github.com/Dirklectisch","followers_url":"https://api.github.com/users/Dirklectisch/followers","following_url":"https://api.github.com/users/Dirklectisch/following{/other_user}","gists_url":"https://api.github.com/users/Dirklectisch/gists{/gist_id}","starred_url":"https://api.github.com/users/Dirklectisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dirklectisch/subscriptions","organizations_url":"https://api.github.com/users/Dirklectisch/orgs","repos_url":"https://api.github.com/users/Dirklectisch/repos","events_url":"https://api.github.com/users/Dirklectisch/events{/privacy}","received_events_url":"https://api.github.com/users/Dirklectisch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-28T16:11:21Z","updated_at":"2016-06-29T07:33:10Z","closed_at":null,"body":"When updating a resource with a new property, the name of that property can not be a list unless you set the is_import flag in the options. This prevents us from defining new props when posting a form (for example adding a field to one of the admin edit screens).\r\n\r\nThe easiest way to reproduce is on the shell with the following expressions.\r\n\r\n````\r\n(zotonic001@15fa29a530ac)13> m_rsc_update:update(1, [{\"sapperdeflap\", 0}], z_acl:sudo(z:c(somesitename))).\r\n** exception error: bad argument\r\n     in function  list_to_existing_atom/1\r\n        called as list_to_existing_atom(\"sapperdeflap\")\r\n     in call from m_rsc_update:map_property_name/2 (src/models/m_rsc_update.erl, line 870)\r\n     in call from m_rsc_update:'-normalize_props/4-lc$^0/1-0-'/2 (src/models/m_rsc_update.erl, line 511)\r\n     in call from m_rsc_update:'-normalize_props/4-lc$^0/1-0-'/2 (src/models/m_rsc_update.erl, line 511)\r\n     in call from m_rsc_update:update_normalize_props/3 (src/models/m_rsc_update.erl, line 297)\r\n(zotonic001@15fa29a530ac)14> m_rsc_update:update(1, [{sapperdeflap, 0}], z_acl:sudo(z:c(somesitename))).  \r\n{ok,1}\r\n(zotonic001@15fa29a530ac)15> m_rsc_update:update(1, [{\"sapperdeflap\", 0}], z_acl:sudo(z:c(somesitename))).\r\n{ok,1}\r\n````\r\n\r\nDo we really need to map each prop name to an atom?"},"comment":{"url":"https://api.github.com/repos/zotonic/zotonic/issues/comments/229278946","html_url":"https://github.com/zotonic/zotonic/issues/1330#issuecomment-229278946","issue_url":"https://api.github.com/repos/zotonic/zotonic/issues/1330","id":229278946,"user":{"login":"ddeboer","id":89267,"avatar_url":"https://avatars.githubusercontent.com/u/89267?v=3","gravatar_id":"","url":"https://api.github.com/users/ddeboer","html_url":"https://github.com/ddeboer","followers_url":"https://api.github.com/users/ddeboer/followers","following_url":"https://api.github.com/users/ddeboer/following{/other_user}","gists_url":"https://api.github.com/users/ddeboer/gists{/gist_id}","starred_url":"https://api.github.com/users/ddeboer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddeboer/subscriptions","organizations_url":"https://api.github.com/users/ddeboer/orgs","repos_url":"https://api.github.com/users/ddeboer/repos","events_url":"https://api.github.com/users/ddeboer/events{/privacy}","received_events_url":"https://api.github.com/users/ddeboer/received_events","type":"User","site_admin":false},"created_at":"2016-06-29T07:33:10Z","updated_at":"2016-06-29T07:33:10Z","body":"@Dirklectisch Would `value={{ custom_thingie|default:\"your static string\" }}` work?"}}
{"actor":{"display_login":"ddeboer"}}