Only after I put my site online, I learned that there's a page with path category/### (### being category ID number). While I don't use that for anything useful, certain anonymous users keep hitting that URL - and each hit writes to my logs:
Missing argument 2 for category_render_nodes(), called in xxxx/sites/all/modules/category/category.pages.inc on line 108 and defined v souboru xxxx/sites/all/modules/category/category.inc na řádku 542.
That's because theme_category_page (which is used by category_page() page callback) calls category_render_nodes($result) - i.e. without the second argument $category_display used in normal node-based view.
Considering that this page is not operating with fully blown node object (which only then might have the category_display property), that it's a simple listing, and that $category_display defaults to NULL even in the normal node-based view (when category_display module is disabled) - AND that all it does inside the function is hide "empty" message... Considering all that, I assume it'll be sufficient to just throw a default NULL in there, so that PHP doesn't scream on missing argument - otherwise I don't see anything really broken.
So, I added the default to the function signature, so that it's fixed once for all. Tiny patch attached.
Comment | File | Size | Author |
---|---|---|---|
cat-missing-arg.patch | 616 bytes | JirkaRybka |
Comments
Comment #1
Jaza CreditAttribution: Jaza commentedCommitted to HEAD. Thanks! See:
#158598: Category port for Drupal 6.x