{"action":"created","issue":{"url":"https://api.github.com/repos/plone/plone.api/issues/99","labels_url":"https://api.github.com/repos/plone/plone.api/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/plone/plone.api/issues/99/comments","events_url":"https://api.github.com/repos/plone/plone.api/issues/99/events","html_url":"https://github.com/plone/plone.api/issues/99","id":12450384,"number":99,"title":"api.content.create replaces archetype-content title with site title during Plone site creation","user":{"login":"datakurre","id":160447,"avatar_url":"https://avatars.githubusercontent.com/u/160447?v=3","gravatar_id":"","url":"https://api.github.com/users/datakurre","html_url":"https://github.com/datakurre","followers_url":"https://api.github.com/users/datakurre/followers","following_url":"https://api.github.com/users/datakurre/following{/other_user}","gists_url":"https://api.github.com/users/datakurre/gists{/gist_id}","starred_url":"https://api.github.com/users/datakurre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datakurre/subscriptions","organizations_url":"https://api.github.com/users/datakurre/orgs","repos_url":"https://api.github.com/users/datakurre/repos","events_url":"https://api.github.com/users/datakurre/events{/privacy}","received_events_url":"https://api.github.com/users/datakurre/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/plone/plone.api/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2013-03-26T14:18:41Z","updated_at":"2015-09-08T11:01:07Z","closed_at":null,"body":"How to reproduce:\r\n\r\n1. Use `plone.api.content.create` to create content in \"setuphandlers.py\" (or custom GS profile configuration step).\r\n\r\n2. Create a new Plone site and select the profile in question to be installed for the new site.\r\n\r\nThen\r\n\r\nEach new Archetype-based content object created with plone.api.content.create will have site title as its title.\r\n\r\nWhy\r\n\r\n1. plone.api.content.create calls Archetypes' processForm-method\r\n2. processForm-method tries to re-fill content fields from request\r\n3. title-widget finds a title field from the request (because the default form for creating a new Plone site has a title field)\r\n\r\nOur local fix is to pop \"title\" key from the request.form before running code with plone.api.content.create.\r\n\r\nBut note that this is not limited to the site creation from but any values in request.form may cause similar surprises with api.content.create.\r\n\r\nIf it's not a feature to read field values for plone.api.content.create from request, then maybe request.form should somehow be cleared before creating Archetypes-content and restored afterwise."},"comment":{"url":"https://api.github.com/repos/plone/plone.api/issues/comments/138518355","html_url":"https://github.com/plone/plone.api/issues/99#issuecomment-138518355","issue_url":"https://api.github.com/repos/plone/plone.api/issues/99","id":138518355,"user":{"login":"pgrunewald","id":2945740,"avatar_url":"https://avatars.githubusercontent.com/u/2945740?v=3","gravatar_id":"","url":"https://api.github.com/users/pgrunewald","html_url":"https://github.com/pgrunewald","followers_url":"https://api.github.com/users/pgrunewald/followers","following_url":"https://api.github.com/users/pgrunewald/following{/other_user}","gists_url":"https://api.github.com/users/pgrunewald/gists{/gist_id}","starred_url":"https://api.github.com/users/pgrunewald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgrunewald/subscriptions","organizations_url":"https://api.github.com/users/pgrunewald/orgs","repos_url":"https://api.github.com/users/pgrunewald/repos","events_url":"https://api.github.com/users/pgrunewald/events{/privacy}","received_events_url":"https://api.github.com/users/pgrunewald/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T11:01:07Z","updated_at":"2015-09-08T11:01:07Z","body":"I am also interested in getting this issue solved.\r\n\r\nMaybe we could use the `values` parameter of processForm and populate it with dictionary containing `title` (if present) and all other passed data from kwargs. That way the request object is not consulted, when retrieving potential form data."}}