inline: fix spurious feed removal from nested inlining
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 26 Aug 2012 05:35:02 +0000 (07:35 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 21 Oct 2019 16:31:07 +0000 (18:31 +0200)
commita71cd1bbc2b226dded190afdb9574ad2ec2438e0
treeab9472be880db907003e1d20c831c3b9a88d7751
parent43c4de5c542f9496a9e257452a4f0cd0ff699721
inline: fix spurious feed removal from nested inlining

Situation:

* page A has an inline directive that (directly) generates a feed F
* page B inlines A, thus (indirectly) generating F again
* page B is rendered after page A

Without this patch, F is rendered by both A and B. However, if a change
in B causes it to _not_ inline A anymore, the following would happen:

* page A is built, rendering F
* page B is built, _not_ rendering F (which it used to render)
* F is removed because it's not rendered by B anymore

With this patch, rendering of F is always controlled by A, preventing
the spurious feed removals from happening.

A wiki rebuild is necessary after this patch is included.

Note that although this issue is triggered by last year's changes
bb8f76a4a04686def8cc6f21bcca80cb2cc3b2c9 and
72c8f01b36c841b0e83a2ad7ad1365b9116075c5 (that allowed feed generation
from nested inlines, coalescing it to be page-based instead of
destpage-based), there is potential for it popping up in other cases.

Specifically, the generated pages removal logic curently relies on the
assumption that a given output has only one generator. This assumption
was violated for feeds with the introduction of the mentioned commits,
and is now being re-instated (for feeds) with this patch, but other
similar cases may pop up for other plugins in the future.
IkiWiki/Plugin/inline.pm