Add a patch tag
[ikiwiki.git] / doc / bugs / Error:_no_text_was_copied_in_this_page_--_missing_page_dependencies.mdwn
1 That one has bitten me for some time; here is the minimal testcase.  There is
2 also an equivalent (I suppose) problem when using another plugin, but I hope
3 it's enough to track it down for this one.
4
5     $ tar -xj < [bug-dep_order.tar.bz2](http://schwinge.homeip.net/~thomas/tmp/bug-dep_order.tar.bz2)
6     $ cd bug-dep_order/
7     $ ./render_locally
8     [...]
9     $ find "$PWD".rendered/ -print0 | xargs -0 grep 'no text was copied'
10     $ [no output]
11     $ touch news/2010-07-31.mdwn 
12     $ ./render_locally 
13     refreshing wiki..
14     scanning news/2010-07-31.mdwn
15     building news/2010-07-31.mdwn
16     building news.mdwn, which depends on news/2010-07-31
17     building index.mdwn, which depends on news/2010-07-31
18     done
19     $ find "$PWD".rendered/ -print0 | xargs -0 grep 'no text was copied'
20     /home/thomas/tmp/hurd-web/bug-dep_order.rendered/news.html:<p>[[!paste <span class="error">Error: no text was copied in this page</span>]]</p>
21     /home/thomas/tmp/hurd-web/bug-dep_order.rendered/news.html:<p>[[!paste <span class="error">Error: no text was copied in this page</span>]]</p>
22
23 This error shows up only for *news.html*, but not in *news/2010-07-31* or for
24 the aggregation in *index.html* or its RSS and atom files.
25
26 --[[tschwinge]]
27
28 > So the cutpaste plugin, in order to support pastes
29 > that come before the corresponding cut in the page,
30 > relies on the scan hook being called for the page
31 > before it is preprocessed.
32
33 > In the case of an inline, this doesn't happen, if
34 > the page in question has not changed.
35
36 > Really though it's not just inline, it's potentially anything
37 > that preprocesses content. None of those things guarantee that
38 > scan gets re-run on it first. 
39
40 > I think cutpaste is going beyond the intended use of scan hooks,
41 > which is to gather link information, not do arbitrary data collection.
42 > Requiring scan be run repeatedly could be a lot more work.
43
44 > Using `%pagestate` to store the cut content when scanning would be 
45 > one way to fix this bug. It would mean storing potentially big chunks 
46 > of page content in the indexdb. [[done]] --[[Joey]]