{"action":"created","issue":{"url":"https://api.github.com/repos/fisharebest/webtrees/issues/759","labels_url":"https://api.github.com/repos/fisharebest/webtrees/issues/759/labels{/name}","comments_url":"https://api.github.com/repos/fisharebest/webtrees/issues/759/comments","events_url":"https://api.github.com/repos/fisharebest/webtrees/issues/759/events","html_url":"https://github.com/fisharebest/webtrees/issues/759","id":114436386,"number":759,"title":"p_id set to '0' when adding new sub-place using previous place","user":{"login":"michelsup","id":11271412,"avatar_url":"https://avatars.githubusercontent.com/u/11271412?v=3","gravatar_id":"","url":"https://api.github.com/users/michelsup","html_url":"https://github.com/michelsup","followers_url":"https://api.github.com/users/michelsup/followers","following_url":"https://api.github.com/users/michelsup/following{/other_user}","gists_url":"https://api.github.com/users/michelsup/gists{/gist_id}","starred_url":"https://api.github.com/users/michelsup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michelsup/subscriptions","organizations_url":"https://api.github.com/users/michelsup/orgs","repos_url":"https://api.github.com/users/michelsup/repos","events_url":"https://api.github.com/users/michelsup/events{/privacy}","received_events_url":"https://api.github.com/users/michelsup/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-31T21:50:10Z","updated_at":"2015-10-31T22:11:18Z","closed_at":null,"body":"When you edit a place, like the birthplace of a new entry, and search for the few first letter of a previously edited place, you get the field populated, e.g \"St Céré, Lot, Midi-Pyrénées, France\".\r\nIf you add another sub-place in front of this, like \"Nowhere, St Céré, Lot, Midi-Pyrénées, France\", you end up, in your database, with an entry like \r\np_id | p_place | p_parent_id | p_file | p_std_soundex | p_dm_soundex\r\n0      | Nowhere | 129            | 1        |L000:V253:L125 | 800000:756349:746349:875634:874634\r\n\r\nThis p_id  screws up everything, as you can imagine. I don't have time to check the code involved, but I can, if you need, provide you with logs and such."},"comment":{"url":"https://api.github.com/repos/fisharebest/webtrees/issues/comments/152777590","html_url":"https://github.com/fisharebest/webtrees/issues/759#issuecomment-152777590","issue_url":"https://api.github.com/repos/fisharebest/webtrees/issues/759","id":152777590,"user":{"login":"michelsup","id":11271412,"avatar_url":"https://avatars.githubusercontent.com/u/11271412?v=3","gravatar_id":"","url":"https://api.github.com/users/michelsup","html_url":"https://github.com/michelsup","followers_url":"https://api.github.com/users/michelsup/followers","following_url":"https://api.github.com/users/michelsup/following{/other_user}","gists_url":"https://api.github.com/users/michelsup/gists{/gist_id}","starred_url":"https://api.github.com/users/michelsup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michelsup/subscriptions","organizations_url":"https://api.github.com/users/michelsup/orgs","repos_url":"https://api.github.com/users/michelsup/repos","events_url":"https://api.github.com/users/michelsup/events{/privacy}","received_events_url":"https://api.github.com/users/michelsup/received_events","type":"User","site_admin":false},"created_at":"2015-10-31T22:11:18Z","updated_at":"2015-10-31T22:11:18Z","body":"Thank you for your quick reply.\r\n\r\nSHOW CREATE TABLE wt_places;\r\n\r\nCREATE TABLE `wt__places` (\r\n `p_id` int(11) NOT NULL DEFAULT '0',\r\n `p_place` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,\r\n `p_parent_id` int(11) DEFAULT NULL,\r\n `p_file` int(11) NOT NULL,\r\n `p_std_soundex` text COLLATE utf8_unicode_ci,\r\n `p_dm_soundex` text COLLATE utf8_unicode_ci\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci\r\n\r\nObviously, as you guessed, p_id is not set properly, as it's not incremented.\r\nI have not set any SQL_MODE anywhere and I have not tweaked anything, this is a plain vanilla installation.\r\nI change p_id to be A.I, let's see."}}