Version: 2.11.1 Reporter: Brian Litzinger —
This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report
This was specifically encountered in EE 2.11, but it probably affects all versions. The channel_entries_query_result hook allows for devs to modify the $results array, but if the entries tag contains a {categories} tag pair, the incorrect categories may be queried. For example, if the entries tag is natively finding entries 1, 2, and 3, but the add-on decides to return 3, 4 and 5, the {categories} tag pair will only have data for entry #3. Below was the fix I got to work, but IMO the mod.channel.php->fetch_categories() method should be re-called immediately after the channel_entries_query_result hook is called so it can re-calculate the categories based on the new set of entries returned by the hook.
public function channel_entries_query_result($channel, $results)
{
// $result[0] is an array of entry_ids
// $result[1] is the new full query object, which is created by looking at ee()->db->queries
$result = ee()->publisher_entry->get_pagination_entries($channel);
$entry_ids = $result[0];
// Re-trigger the setting collection of the categories array
$channel->query = $result[1];
$channel->fetch_categories();
...
Getting the new query object is quite the task, but thats beside the point. The category data should be auto re-calculated somehow after the hook is called, otherwise the {categories} pair may not be in sync with what the hook is returning.
ExpressionEngine implements Markdown Extra and BBCode. Please see the Markdown Extra docs and the BBCode Wikipedia article for a full reference.
**bold**
, __bold__
, *italics*
, _italics_
, ~strike/del~
, `code()`
bold, italics, strike/del, code()
Link: [link title](https://example.com)
Image: ![alt text](https://example.com/image.jpg)
[blockquote]...[/blockquote]
, [quote]...[/quote]
, and Markdown style:
> Some quoted text. > > This is all one quote.
[code]...[/code]
, and you can also specify the language for syntax highlighting, [code=php]...[/code]
GitHub flavored Markdown code fences are also supported:
``` public function decoderRing($str) { return str_rot13($str); } ```