{"action":"closed","number":8239,"pull_request":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/8239","id":224240177,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0MjQwMTc3","html_url":"https://github.com/qgis/QGIS/pull/8239","diff_url":"https://github.com/qgis/QGIS/pull/8239.diff","patch_url":"https://github.com/qgis/QGIS/pull/8239.patch","issue_url":"https://api.github.com/repos/qgis/QGIS/issues/8239","number":8239,"state":"closed","locked":false,"title":"[server] Removes assert","user":{"login":"pblottiere","id":9266424,"node_id":"MDQ6VXNlcjkyNjY0MjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/9266424?v=4","gravatar_id":"","url":"https://api.github.com/users/pblottiere","html_url":"https://github.com/pblottiere","followers_url":"https://api.github.com/users/pblottiere/followers","following_url":"https://api.github.com/users/pblottiere/following{/other_user}","gists_url":"https://api.github.com/users/pblottiere/gists{/gist_id}","starred_url":"https://api.github.com/users/pblottiere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pblottiere/subscriptions","organizations_url":"https://api.github.com/users/pblottiere/orgs","repos_url":"https://api.github.com/users/pblottiere/repos","events_url":"https://api.github.com/users/pblottiere/events{/privacy}","received_events_url":"https://api.github.com/users/pblottiere/received_events","type":"User","site_admin":false},"body":"## Description\r\n\r\nCondition to reproduce the assert:\r\n- `xvfb-run` is used \r\n- a legend item is defined in a layout within the .qgs project that the server is reading\r\n- use a simple request with only the `MAP` parameter (like \"http://localhost/qgisserver?MAP=/.../.../.../myproject.qgs\")\r\n\r\nActually, for some obscure reason, the `QPainter` is, in this particular case, not correctly initialized in [QgsSymbolLayerUtils::symbolPreviewPixmap](https://github.com/qgis/QGIS/blob/master/src/core/symbology/qgssymbollayerutils.cpp#L658-L659) when the project is read (the xml concerning the layout):\r\n\r\n```\r\nQPainter::begin: Paint device returned engine == 0, type: 2\r\nQPainter::setRenderHint: Painter must be active to set rendering hints\r\nQPainter::setBrush: Painter not active\r\nQPainter::setPen: Painter not active\r\nQPainter::drawPath: Painter not active\r\nQPainter::end: Painter not active, aborted\r\n```\r\n\r\nIt leads to an assert raised by  https://github.com/qgis/QGIS/blob/master/src/core/layertree/qgslayertreemodel.cpp#L1530 when the server is reading the project file:\r\n\r\n```\r\nASSERT: \"widthMax[parentKey] > 0\"\r\n```\r\n\r\nWhat is even more worrying is that the server is not aborted on the first request, but on the second one due to the default flag [DeferredLegendInvalidation](https://github.com/qgis/QGIS/blob/master/src/core/layertree/qgslayertreemodel.cpp#L1496) and the [qApp->processEvents();](https://github.com/qgis/QGIS/blob/master/src/server/qgsserver.cpp#L277).\r\n\r\nI don't have a clue why the `QPainter` cannot be initialized, but it seems a bit overkill to abort the server when the icon size cannot be determined anyway.\r\n\r\nPlease, share your opinions :).\r\n\r\nTODO:\r\n- check the layout rendering once the Q_ASSERT is removed: rendered image is valid\r\n- write a Python unit test with xvfbwrapper to reproduce the abort: cannot reproduce the issue\r\n\r\n## Checklist\r\n\r\n- [ ] Commit messages are descriptive and explain the rationale for changes\r\n- [ ] Commits which fix bugs include `fixes #11111` in the commit message next to the description\r\n- [ ] Commits which add new features are tagged with `[FEATURE]` in the commit message\r\n- [ ] Commits which change the UI or existing user workflows are tagged with `[needs-docs]` in the commit message and contain sufficient information in the commit message to be documented\r\n- [ ] I have read the [QGIS Coding Standards](https://docs.qgis.org/testing/en/docs/developers_guide/codingstandards.html) and this PR complies with them\r\n- [ ] This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)\r\n- [ ] New unit tests have been added for core changes\r\n- [ ] I have run [the `scripts/prepare-commit.sh` script](https://github.com/qgis/QGIS/blob/master/.github/CONTRIBUTING.md#contributing-to-qgis) before each commit\r\n","created_at":"2018-10-19T10:26:06Z","updated_at":"2018-11-11T21:46:36Z","closed_at":"2018-11-11T21:46:36Z","merged_at":null,"merge_commit_sha":"a9299eb14258efabf8110898678793e7aee5d5d4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":977716635,"node_id":"MDU6TGFiZWw5Nzc3MTY2MzU=","url":"https://api.github.com/repos/qgis/QGIS/labels/stale","name":"stale","color":"cccccc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/qgis/QGIS/pulls/8239/commits","review_comments_url":"https://api.github.com/repos/qgis/QGIS/pulls/8239/comments","review_comment_url":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qgis/QGIS/issues/8239/comments","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/97ae8c8afad4d7951d2da17bf6898ffd7a9afea7","head":{"label":"pblottiere:server_layout_legend_assert","ref":"server_layout_legend_assert","sha":"97ae8c8afad4d7951d2da17bf6898ffd7a9afea7","user":{"login":"pblottiere","id":9266424,"node_id":"MDQ6VXNlcjkyNjY0MjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/9266424?v=4","gravatar_id":"","url":"https://api.github.com/users/pblottiere","html_url":"https://github.com/pblottiere","followers_url":"https://api.github.com/users/pblottiere/followers","following_url":"https://api.github.com/users/pblottiere/following{/other_user}","gists_url":"https://api.github.com/users/pblottiere/gists{/gist_id}","starred_url":"https://api.github.com/users/pblottiere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pblottiere/subscriptions","organizations_url":"https://api.github.com/users/pblottiere/orgs","repos_url":"https://api.github.com/users/pblottiere/repos","events_url":"https://api.github.com/users/pblottiere/events{/privacy}","received_events_url":"https://api.github.com/users/pblottiere/received_events","type":"User","site_admin":false},"repo":{"id":52591632,"node_id":"MDEwOlJlcG9zaXRvcnk1MjU5MTYzMg==","name":"QGIS","full_name":"pblottiere/QGIS","private":false,"owner":{"login":"pblottiere","id":9266424,"node_id":"MDQ6VXNlcjkyNjY0MjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/9266424?v=4","gravatar_id":"","url":"https://api.github.com/users/pblottiere","html_url":"https://github.com/pblottiere","followers_url":"https://api.github.com/users/pblottiere/followers","following_url":"https://api.github.com/users/pblottiere/following{/other_user}","gists_url":"https://api.github.com/users/pblottiere/gists{/gist_id}","starred_url":"https://api.github.com/users/pblottiere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pblottiere/subscriptions","organizations_url":"https://api.github.com/users/pblottiere/orgs","repos_url":"https://api.github.com/users/pblottiere/repos","events_url":"https://api.github.com/users/pblottiere/events{/privacy}","received_events_url":"https://api.github.com/users/pblottiere/received_events","type":"User","site_admin":false},"html_url":"https://github.com/pblottiere/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":true,"url":"https://api.github.com/repos/pblottiere/QGIS","forks_url":"https://api.github.com/repos/pblottiere/QGIS/forks","keys_url":"https://api.github.com/repos/pblottiere/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pblottiere/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pblottiere/QGIS/teams","hooks_url":"https://api.github.com/repos/pblottiere/QGIS/hooks","issue_events_url":"https://api.github.com/repos/pblottiere/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/pblottiere/QGIS/events","assignees_url":"https://api.github.com/repos/pblottiere/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/pblottiere/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/pblottiere/QGIS/tags","blobs_url":"https://api.github.com/repos/pblottiere/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pblottiere/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pblottiere/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/pblottiere/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pblottiere/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/pblottiere/QGIS/languages","stargazers_url":"https://api.github.com/repos/pblottiere/QGIS/stargazers","contributors_url":"https://api.github.com/repos/pblottiere/QGIS/contributors","subscribers_url":"https://api.github.com/repos/pblottiere/QGIS/subscribers","subscription_url":"https://api.github.com/repos/pblottiere/QGIS/subscription","commits_url":"https://api.github.com/repos/pblottiere/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/pblottiere/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/pblottiere/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/pblottiere/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/pblottiere/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/pblottiere/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pblottiere/QGIS/merges","archive_url":"https://api.github.com/repos/pblottiere/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pblottiere/QGIS/downloads","issues_url":"https://api.github.com/repos/pblottiere/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/pblottiere/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/pblottiere/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/pblottiere/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pblottiere/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/pblottiere/QGIS/releases{/id}","deployments_url":"https://api.github.com/repos/pblottiere/QGIS/deployments","created_at":"2016-02-26T08:56:30Z","updated_at":"2018-11-09T11:29:51Z","pushed_at":"2018-11-09T11:29:27Z","git_url":"git://github.com/pblottiere/QGIS.git","ssh_url":"git@github.com:pblottiere/QGIS.git","clone_url":"https://github.com/pblottiere/QGIS.git","svn_url":"https://github.com/pblottiere/QGIS","homepage":"http://qgis.org","size":1463681,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"qgis:master","ref":"master","sha":"7ad0dcfa71b6bebc431d4d4f92c1c3cd644b5323","user":{"login":"qgis","id":483444,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ4MzQ0NA==","avatar_url":"https://avatars3.githubusercontent.com/u/483444?v=4","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"repo":{"id":1690480,"node_id":"MDEwOlJlcG9zaXRvcnkxNjkwNDgw","name":"QGIS","full_name":"qgis/QGIS","private":false,"owner":{"login":"qgis","id":483444,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ4MzQ0NA==","avatar_url":"https://avatars3.githubusercontent.com/u/483444?v=4","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/qgis/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":false,"url":"https://api.github.com/repos/qgis/QGIS","forks_url":"https://api.github.com/repos/qgis/QGIS/forks","keys_url":"https://api.github.com/repos/qgis/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qgis/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qgis/QGIS/teams","hooks_url":"https://api.github.com/repos/qgis/QGIS/hooks","issue_events_url":"https://api.github.com/repos/qgis/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/qgis/QGIS/events","assignees_url":"https://api.github.com/repos/qgis/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/qgis/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/qgis/QGIS/tags","blobs_url":"https://api.github.com/repos/qgis/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qgis/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qgis/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/qgis/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/qgis/QGIS/languages","stargazers_url":"https://api.github.com/repos/qgis/QGIS/stargazers","contributors_url":"https://api.github.com/repos/qgis/QGIS/contributors","subscribers_url":"https://api.github.com/repos/qgis/QGIS/subscribers","subscription_url":"https://api.github.com/repos/qgis/QGIS/subscription","commits_url":"https://api.github.com/repos/qgis/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/qgis/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/qgis/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/qgis/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/qgis/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/qgis/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qgis/QGIS/merges","archive_url":"https://api.github.com/repos/qgis/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qgis/QGIS/downloads","issues_url":"https://api.github.com/repos/qgis/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/qgis/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/qgis/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/qgis/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qgis/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/qgis/QGIS/releases{/id}","deployments_url":"https://api.github.com/repos/qgis/QGIS/deployments","created_at":"2011-05-02T08:06:26Z","updated_at":"2018-11-11T18:14:45Z","pushed_at":"2018-11-11T21:18:33Z","git_url":"git://github.com/qgis/QGIS.git","ssh_url":"git@github.com:qgis/QGIS.git","clone_url":"https://github.com/qgis/QGIS.git","svn_url":"https://github.com/qgis/QGIS","homepage":"http://qgis.org","size":1481301,"stargazers_count":2299,"watchers_count":2299,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1347,"mirror_url":null,"archived":false,"open_issues_count":35,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":1347,"open_issues":35,"watchers":2299,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/8239"},"html":{"href":"https://github.com/qgis/QGIS/pull/8239"},"issue":{"href":"https://api.github.com/repos/qgis/QGIS/issues/8239"},"comments":{"href":"https://api.github.com/repos/qgis/QGIS/issues/8239/comments"},"review_comments":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/8239/comments"},"review_comment":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/8239/commits"},"statuses":{"href":"https://api.github.com/repos/qgis/QGIS/statuses/97ae8c8afad4d7951d2da17bf6898ffd7a9afea7"}},"author_association":"MEMBER","merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"clean","merged_by":null,"comments":3,"review_comments":1,"maintainer_can_modify":false,"commits":1,"additions":0,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"stale"}}