suntrop Posted April 22, 2018 Share Posted April 22, 2018 I get this notice when using markup cache Quote Notice: Object of class ProcessWire\Selectors could not be converted to int in /usr/local/www/apache24/noexec//online/example/dev/wire/core/PagesLoader.php on line 534 It is more or less the same from https://modules.processwire.com/modules/markup-cache/ $cache = $modules->get("MarkupCache"); if (!$data = $cache->get("tablerows__pageid_" . $page->id)) { $data = ''; foreach ($page->children('limit=499') as $child): $data .= '<tr>'; $data .= '<td>'; $data .= implode(" | ", $child->title); $data .= '</td>'; $data .= '</tr>'; endforeach; $cache->save($data); } // output cached table rows echo $data; Is there anything wrong or has something changed? Do I need to check if the cache file exists? Link to comment Share on other sites More sharing options...
Robin S Posted April 22, 2018 Share Posted April 22, 2018 A couple of things that might be relevant to the problem: 4 hours ago, suntrop said: $cache = $modules->get("MarkupCache"); 1. $cache is an API variable (WireCache) - better not overwrite it with something else. 2. WireCache provides everything that the MarkupCache module does plus more. Maybe consider using WireCache instead. Link to comment Share on other sites More sharing options...
suntrop Posted April 23, 2018 Author Share Posted April 23, 2018 Thanks, didn't know WireCache before. I googled for cache and top results were all markup cache. The Notice however was the same, but it turned our, it came from $page->children('limit=499') When I remove the limit there is no notice. Luckily I don't need that limit Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now