Open fthommen opened 2 years ago
The links are already registered by the include plugin… https://github.com/dokufreaks/plugin-include/blob/dffff5e183b89f51de64f71523bcc7460e0a241d/action.php#L327-L329
Does this mean that it should work (and we might have some other kind of issue at our site), or that the implementation in the include plugin is only partially complete/working?
Yes I would expect that it works. If it does not, something is going on.
Could you please share a minimal example of pages with their minimal content which I could create, to replicate your situation?
I have reproduced the issue on two other DokuWikis (all hogfather) which have different set of installed plugins. The almost - the title in include
is technically not required :-) - minimal test case is
:include
:
====== Master ======
{{page>include_this}}
:include_this
:
====== Include This ======
Results in:
After I have renamed include_this
to include_that
using the move plugin, the master document is broken:
HTH
I have no idea, how this "automatic rewriting" of renamed pages works, but could the issue be related to #251?
Sure!
This is possibly related but I have found that when using {{tagtopic>some_tag&linkonly&exclude=/c_template/}}
and then using Move plugin to change the name of the pages the include statement changes to
{{tagtopic>changed:namespace:path:some_tag&linkonly&exclude=/c_template/}}
adding "changed:namespace:path" to the "some_tag" which is obviously creating a nonsense include statement that mixes namespace and tag.
I have reproduced the issue on two other DokuWikis
I can reproduce this on "Jack Jackrum". The only difference to the example above was that I did everything in the namespace test
.
After renaming the page test:include_this
to test:include_that
, {{page>test:include_this}}
remains unchanged on the test page. After renaming the page back to test:include_this
it worked correctly again.
I just added a commit that implements registering the "relation_references" key for the included pages in the indexer. The move plugin and the backlinks page (see #251) lookup this meta key in the indexer. Right now the include plugin updates the meta data for the relation of the page - but this does not automatically get inserted into the index (see https://www.dokuwiki.org/devel:metadata#metadata_index).
This seems to fix the move adaption of the link in the include syntax. I'll test this and create a pull request after validation.
Edit: I have just seen that this plugin also adds meta data in an action (action function: handle_indexer). I'll add a commit for this later.
When pages are renamed (using the
move
plugin), the ID doesn't change in the include directive, thus breaking the inclusion. Since there seems to be a mechanism to update page IDs automatically (e.g. in internal links), maybe this mechanism could also be used by theinclude
plugin?DW version is Hogfather,
move
andinclude
plugin are up to date.