wilr / silverstripe-googlesitemaps

Google Sitemaps module for the SilverStripe CMS
BSD 3-Clause "New" or "Revised" License
74 stars 95 forks source link

limit should work with canIncludeInGoogleSitemap #112

Closed sunnysideup closed 8 years ago

sunnysideup commented 8 years ago

see: https://github.com/wilr/silverstripe-googlesitemaps/blob/master/code/GoogleSitemap.php#L272-L284

First the code limits the numbers and then it checks for canIncludeInGoogleSitemap. It seems to me that it should be the other way around so that you end up with empty lists (i.e. filter before limit).

wilr commented 8 years ago

You have to limit it prior to the loop to avoid crashing the server looping over every record. See this issue for notes on empty pages #61