Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page renaming breaks inclusion #276

Open
fthommen opened this issue Jan 22, 2022 · 9 comments
Open

Page renaming breaks inclusion #276

fthommen opened this issue Jan 22, 2022 · 9 comments

Comments

@fthommen
Copy link

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 the include plugin?

DW version is Hogfather, move and include plugin are up to date.

@Klap-in
Copy link
Member

Klap-in commented Jan 23, 2022

The links are already registered by the include plugin…

plugin-include/action.php

Lines 327 to 329 in dffff5e

public function handle_move_register(Doku_Event $event, $params) {
$event->data['handlers']['include_include'] = array($this, 'rewrite_include');
}

@fthommen
Copy link
Author

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?

@Klap-in
Copy link
Member

Klap-in commented Jan 23, 2022

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?

@fthommen
Copy link
Author

fthommen commented Jan 23, 2022

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:
image

After I have renamed include_this to include_that using the move plugin, the master document is broken:
image

HTH

@fthommen
Copy link
Author

I have no idea, how this "automatic rewriting" of renamed pages works, but could the issue be related to #251?

@Klap-in
Copy link
Member

Klap-in commented Jan 23, 2022

Sure!

@GitWonder
Copy link

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.

@fiwswe
Copy link

fiwswe commented Apr 6, 2023

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.

@lprobsth
Copy link

lprobsth commented Jan 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants