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

When changing links on pages, the move plugin should mark these pages as changed #212

Open
erik-alm opened this issue Jan 15, 2022 · 2 comments
Labels

Comments

@erik-alm
Copy link

I had this strange problem that sometimes when I open a section of a page (editing a headline and its content) part of the headline gets clipped off or a few characters of the previous section get included in the edit.

I just now realized this happens on pages that link to other pages that have been renamed. Because the rename added or removed a few characters so now the knowledge of where sections start and end is inaccurate. (The page in question is of course displayed in my browser and reloading the page would have solved the problem...)

When someone else has edited a page you have opened in your browser and you want to edit a section you get a warning and the whole page opens for editing instead of just the section.

Whatever state on the page is changed by editing it should also be changed when the move plugin changes the content of that page.

@erik-alm erik-alm changed the title When changing links on pages, the move plugin must mark these pages as changed When changing links on pages, the move plugin should mark these pages as changed Jan 15, 2022
@michitux
Copy link
Owner

The move plugin registers a regular edit when changing a page. A guess (I haven't looked into the details) is that links were not directly adapted when the other page has been moved. In this case, the rewriting happens when the page is read. The check that triggers the warning is before the page is read, and thus doesn't trigger the warning. Probably the read call that triggers the rewrite is not the one loading the page for editing. If this is the case it might be possible to re-execute the code that triggers the warning but this is not very clean.

Looking at the code I have the impression that this rewriting could trigger all kinds of other bugs as it is really an unexpected behavior that reading the page changes its modification time and content on disk. On the other hand, a concurrent request could do the same as long as the page hasn't been locked (and it hasn't been locked at that point), so DokuWiki just isn't very safe here, either.

@michitux michitux added the bug label Jan 26, 2022
@erik-alm
Copy link
Author

erik-alm commented Jul 27, 2022

Interesting.

As far as I can remember I haven't touched my Dokuwiki version (there is a whole paranoid testing thing with that) and I haven't upgraded the plugin (almost the same level of testing for plugins).

And, when I have a page (A) open in one browser tab and then move a page (B) linked from (A), and finally open a section on (A) I now do get the warning message that the page has been changed and I have to reload the page to edit the section or edit the whole page as per the warning message.

I.e. a correct and expected behavior.

I'm just not at all sure why... the browser is also the same.

Or has this issue been addressed in some way?

Otherwise, I guess I should cross my fingers and hope it sticks...? :-)

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

No branches or pull requests

2 participants