{"issue":{"created_at":"2011-11-29T18:39:23Z","state":"closed","updated_at":"2011-11-29T18:39:26Z","user":{"gravatar_id":"9994df352157ae1b778b792744bdbf05","id":1073273,"url":"https://api.github.com/users/aschempp","login":"aschempp","avatar_url":"https://secure.gravatar.com/avatar/9994df352157ae1b778b792744bdbf05?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":2,"body":"Bei einem Update von 2.5 auf 2.8.2 ist mir aufgefallen, dass die Option skipFirst nicht funktioniert, wenn sowohl perPage als auch news_numberOfItems leer ist. Fürher hat dies funktioniert, da der erste Datensatz des Resultates übersprungen wurde, neu funktioniert das über LIMIT, welches nur ausgeführt wird, wenn perPage/news_numberOfItems vorhanden ist.\n\nLösen konnte ich das Problem mit folgender Anpassung in der ModuleNewsList:\n\n```\n\t\t// Split results\n\t\tif (($this->perPage > 0 && (\n\n![](isset($limit) || $this->news_numberOfItems > $this->perPage)) || $skipFirst > 0)\n\t\t{\n\t\t\t// Get total number of items\n\t\t\t$objTotal = $this->Database->execute(\"SELECT COUNT(*) AS total FROM tl_news WHERE pid IN(\" . implode(',', array_map('intval', $this->news_archives)) . \")\" . ($this->news_featured ? \" AND featured=1\" : \"\") . ()BE_USER_LOGGED_IN ? \" AND (start='' OR start<$time) AND (stop='' OR stop>$time) AND published=1\" : \"\") . \" ORDER BY date DESC\");\n\t\t\t$total = $objTotal->total - $skipFirst;\n\t\t\t\n\t\t\t// Skip only\n\t\t\tif ($this->perPage == 0 && $this->news_numberOfItems == 0)\n\t\t\t{\n\t\t\t\t$this->perPage = $total;\n\t\t\t}\n```\n\n(erste IF-Schlaufe angepasst und zusätzliche Abfrage eingebaut.\n\n--- _Originally created on April 21st, 2010, at 05:07pm (ID 1872)_","assignee":{"gravatar_id":"87d2e5aefadcb310f9155df28c2b3582","id":1192057,"url":"https://api.github.com/users/leofeyer","login":"leofeyer","avatar_url":"https://secure.gravatar.com/avatar/87d2e5aefadcb310f9155df28c2b3582?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":2389833,"labels":[{"name":"Feature","color":"4183c4","url":"https://api.github.com/repos/contao/import/labels/Feature"},{"name":"news","color":"e6e6e6","url":"https://api.github.com/repos/contao/import/labels/news"}],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":1872,"title":"ModuleNewsList: skipFirst funktioniert nicht wenn limit leer ist","closed_at":"2011-11-29T18:39:26Z","html_url":"https://github.com/contao/import/issues/1872","url":"https://api.github.com/repos/contao/import/issues/1872","milestone":{"created_at":"2011-11-29T15:29:52Z","state":"closed","due_on":null,"closed_issues":13,"creator":{"gravatar_id":"87d2e5aefadcb310f9155df28c2b3582","id":1192057,"url":"https://api.github.com/users/leofeyer","login":"leofeyer","avatar_url":"https://secure.gravatar.com/avatar/87d2e5aefadcb310f9155df28c2b3582?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"number":30,"description":"TYPOlight 2.8.3 (maintenance release)","title":"2.8.3","url":"https://api.github.com/repos/contao/import/milestones/30","open_issues":0}},"action":"closed"}