{"action":"created","issue":{"url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/2773","labels_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/2773/labels{/name}","comments_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/2773/comments","events_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/2773/events","html_url":"https://github.com/PrestaShop/PrestaShop/pull/2773","id":64948036,"number":2773,"title":"[-] CORE: Fix inserting HTML configuration variable first time","user":{"login":"gskema","id":5542423,"avatar_url":"https://avatars.githubusercontent.com/u/5542423?v=3","gravatar_id":"","url":"https://api.github.com/users/gskema","html_url":"https://github.com/gskema","followers_url":"https://api.github.com/users/gskema/followers","following_url":"https://api.github.com/users/gskema/following{/other_user}","gists_url":"https://api.github.com/users/gskema/gists{/gist_id}","starred_url":"https://api.github.com/users/gskema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gskema/subscriptions","organizations_url":"https://api.github.com/users/gskema/orgs","repos_url":"https://api.github.com/users/gskema/repos","events_url":"https://api.github.com/users/gskema/events{/privacy}","received_events_url":"https://api.github.com/users/gskema/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PrestaShop/PrestaShop/labels/bug%20fix","name":"bug fix","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-28T14:29:43Z","updated_at":"2015-07-29T07:39:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/2773","html_url":"https://github.com/PrestaShop/PrestaShop/pull/2773","diff_url":"https://github.com/PrestaShop/PrestaShop/pull/2773.diff","patch_url":"https://github.com/PrestaShop/PrestaShop/pull/2773.patch"},"body":"This method `updateValue` uses direct SQL to insert/update data everywhere except when inserting \r\nnon-lang new configration key (doesn't exist yet). In this case object model is used. Adding via ObjectModel cannot insert HTML, because `'validate' = 'isCleanHtml'` is not set for `value` column in `Configuration` model definition (I assume to avoid overhead calls). The fixes are:\r\n\r\n- use direct SQL to insert this new variable (used in this case)\r\n- add a new property to `ObjectModel` column definitions `'html' = true`.\r\n\r\nI don't know which one do you prefer, please tell me.\r\n\r\nAlso, I noticed a lot of `Db::getInstance` calls in this method. Maybe i would be better to save the instance outsite `foreach` loop ? `$db = Db::getInstance` or even `if (!ObjectModel::$db) { ObjectModel::$db =  Db::getInstance }`. Can you comment on that ?"},"comment":{"url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/comments/125870859","html_url":"https://github.com/PrestaShop/PrestaShop/pull/2773#issuecomment-125870859","issue_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/2773","id":125870859,"user":{"login":"xGouley","id":12794114,"avatar_url":"https://avatars.githubusercontent.com/u/12794114?v=3","gravatar_id":"","url":"https://api.github.com/users/xGouley","html_url":"https://github.com/xGouley","followers_url":"https://api.github.com/users/xGouley/followers","following_url":"https://api.github.com/users/xGouley/following{/other_user}","gists_url":"https://api.github.com/users/xGouley/gists{/gist_id}","starred_url":"https://api.github.com/users/xGouley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xGouley/subscriptions","organizations_url":"https://api.github.com/users/xGouley/orgs","repos_url":"https://api.github.com/users/xGouley/repos","events_url":"https://api.github.com/users/xGouley/events{/privacy}","received_events_url":"https://api.github.com/users/xGouley/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T07:39:50Z","updated_at":"2015-07-29T07:39:50Z","body":":+1: \r\nTested, OK.\r\nLinked to #PSCSX-6302 also.\r\n"}}