{"action":"created","issue":{"url":"https://api.github.com/repos/zenphoto/zenphoto/issues/1168","repository_url":"https://api.github.com/repos/zenphoto/zenphoto","labels_url":"https://api.github.com/repos/zenphoto/zenphoto/issues/1168/labels{/name}","comments_url":"https://api.github.com/repos/zenphoto/zenphoto/issues/1168/comments","events_url":"https://api.github.com/repos/zenphoto/zenphoto/issues/1168/events","html_url":"https://github.com/zenphoto/zenphoto/issues/1168","id":334977924,"node_id":"MDU6SXNzdWUzMzQ5Nzc5MjQ=","number":1168,"title":"Problem with getLink() by getRandomImages()","user":{"login":"mebels","id":36734239,"node_id":"MDQ6VXNlcjM2NzM0MjM5","avatar_url":"https://avatars3.githubusercontent.com/u/36734239?v=4","gravatar_id":"","url":"https://api.github.com/users/mebels","html_url":"https://github.com/mebels","followers_url":"https://api.github.com/users/mebels/followers","following_url":"https://api.github.com/users/mebels/following{/other_user}","gists_url":"https://api.github.com/users/mebels/gists{/gist_id}","starred_url":"https://api.github.com/users/mebels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mebels/subscriptions","organizations_url":"https://api.github.com/users/mebels/orgs","repos_url":"https://api.github.com/users/mebels/repos","events_url":"https://api.github.com/users/mebels/events{/privacy}","received_events_url":"https://api.github.com/users/mebels/received_events","type":"User","site_admin":false},"labels":[{"id":83536285,"node_id":"MDU6TGFiZWw4MzUzNjI4NQ==","url":"https://api.github.com/repos/zenphoto/zenphoto/labels/works%20as%20intended","name":"works as intended","color":"bfe5bf","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-22T18:34:21Z","updated_at":"2018-06-22T20:04:49Z","closed_at":"2018-06-22T19:40:11Z","author_association":"NONE","body":"Hello,\r\ni use the getRandomImages() function and this break my website, but not every time, coincidence.\r\n\r\n<pre><code>\r\n{32368:Fri, 22 Jun 2018 18:24:04 GMT} Zenphoto v1.5\r\n  EXCEPTION (0): Call to a member function getLink() on null in /var/www/virtual/xxx/html/themes/basic/image.php on line 270\r\n</code></pre>\r\n\r\n<pre><code>\r\n$randomimage_a = getRandomImages();\r\n$randomimage_b = getRandomImages();\r\n$randomimage_c = getRandomImages();\r\n\r\necho $randomimage_a->getLink()\r\necho $randomimage_a->getThumb()\r\n\r\necho $randomimage_b->getLink()\r\necho $randomimage_b->getThumb()\r\n\r\necho $randomimage_c->getLink()\r\necho $randomimage_c->getThumb()\r\n</code></pre>\r\n\r\nIf the first has an error, then it breaks off already.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/zenphoto/zenphoto/issues/comments/399566566","html_url":"https://github.com/zenphoto/zenphoto/issues/1168#issuecomment-399566566","issue_url":"https://api.github.com/repos/zenphoto/zenphoto/issues/1168","id":399566566,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTU2NjU2Ng==","user":{"login":"mebels","id":36734239,"node_id":"MDQ6VXNlcjM2NzM0MjM5","avatar_url":"https://avatars3.githubusercontent.com/u/36734239?v=4","gravatar_id":"","url":"https://api.github.com/users/mebels","html_url":"https://github.com/mebels","followers_url":"https://api.github.com/users/mebels/followers","following_url":"https://api.github.com/users/mebels/following{/other_user}","gists_url":"https://api.github.com/users/mebels/gists{/gist_id}","starred_url":"https://api.github.com/users/mebels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mebels/subscriptions","organizations_url":"https://api.github.com/users/mebels/orgs","repos_url":"https://api.github.com/users/mebels/repos","events_url":"https://api.github.com/users/mebels/events{/privacy}","received_events_url":"https://api.github.com/users/mebels/received_events","type":"User","site_admin":false},"created_at":"2018-06-22T20:04:49Z","updated_at":"2018-06-22T20:04:49Z","author_association":"NONE","body":"What means \"May be NULL if none exists\" exactly?\r\nNULL = no images in the folders?\r\nNULL = no images in the database?\r\nIn both images exists.\r\nIs there a problem with unpublished images?\r\n\r\nI have tested yet this:\r\n`<?php echo printRandomImages(); ?>`\r\nOK, no breaks, but randomly 0 to 5 images are displayed. not perfect. I search for a solution to display always 3.\r\n\r\nIs there a problem with the MySQL command?\r\n`'SELECT `folder`, `filename` ' . ' FROM ' . prefix('images') . ' INNER JOIN ' . prefix('albums') . ' ON ' . prefix('images') . '.albumid = ' . prefix('albums') . '.id ' . ' INNER JOIN (SELECT CEIL(RAND() * (SELECT MAX(id) FROM ' . prefix('images') . ')) AS id) AS r2 ON ' . prefix('images') . '.id >= r2.id ' . ' WHERE ' . prefix('albums') . '.folder!=\"\" ' . $imageWhere . ' ORDER BY ' . prefix('images') . '.id LIMIT 1'`"}}
{"actor":{"display_login":"mebels"}}