chyrp/chyrp — pull request #173 by xenocrat (2013-09-21 12:23:37+00:00)
Title: Setting higher priority for Aggregrator to avoid clash with Categorize module

Here's the problem as I understand it:

`main_index` is a trigger action. Both modules, Aggregator and Categorize, contain a function named `main_index` so they will both respond to this trigger when the blog index is loaded by the Main controller.

Categorize responds by using `main->display`, causing the page to be rendered and displayed. It then returns `true` which I assume to be the correct way to tell the Main controller "Hey there! I've caused the page to be displayed, so no need for you to do it. Ok thx bai!"

Aggregrator responds by checking if there is stuff it needs to do, doing that stuff, and then returning `false`.

Now the trouble begins...

If the Aggregator module runs *after* the Categorize module, it returns false and the Main controller forgets that Categorize returned true – so the controller thinks nobody has displayed the page and *it* needs to do it. Voila, we get a double page because it's being rendered twice.

You can hack a fix by reordering your modules so that Aggregator runs before Categorize: open your file `config.yaml.php` and in the list of enabled modules, make sure Categorize is the lower of the two, with a higher number than Aggregator.

For the proper fix, this change explicitly sets the priority of Aggregator module to a higher value, ensuring that it runs before Categorize and therefore the Main controller will not get misinformed that it needs to render the page.