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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: workaround premature metadata generation on page save 馃悰 #2401

Merged
merged 1 commit into from Oct 15, 2019

Conversation

micgro42
Copy link
Collaborator

This fixes a bug where the creator of a new page was not saved to metadata.
That could happen if a plugin calls pageinfo() in the IO_WIKIPAGE_WRITE
event's AFTER handler. This creates a new .meta file for the page with the
page's mtime as the creation timestamp. That caused the if clause
changed in this commit to evaluate as false and thus the creator key was
not saved.

This commit now also treats the page as newly created if the created
date in the metadata is equal to the file's current mtime.

This fixes a bug where the creator of a new page was not saved to metadata.
That could happen if a plugin calls pageinfo() in the IO_WIKIPAGE_WRITE
event AFTER handler. This creates a new .meta file for the page with the
page's mtime as the creation timestamp. That caused the if clause
changed in this commit to evaluate as false and thus the creator key was
not saved.

This commit now also treats the page as newly created if the created
date in the metadata to the file's current mtime.
micgro42 added a commit to cosmocode/dokuwiki-plugin-publish that referenced this pull request May 23, 2018
Calling pageinfo() durint IO_WIKIPAGE_WRITE of newly created pages
caused the page's metadata file to be written prematurely which in turn
caused the creator to be omitted from the page's metadata.

This reworks the create_mail_body action to no longer call pageinfo().

See also dokuwiki/dokuwiki#2401
micgro42 added a commit to cosmocode/dokuwiki-plugin-publish that referenced this pull request May 23, 2018
Calling pageinfo() durint IO_WIKIPAGE_WRITE of newly created pages
caused the page's metadata file to be written prematurely which in turn
caused the creator to be omitted from the page's metadata.

This reworks the create_mail_body action to no longer call pageinfo().

See also dokuwiki/dokuwiki#2401
@splitbrain splitbrain added this to Triage in PSR-2 Finishing via automation Oct 10, 2019
@splitbrain splitbrain moved this from Triage to Needs Work in PSR-2 Finishing Oct 15, 2019
@splitbrain splitbrain merged commit 3af323c into master Oct 15, 2019
PSR-2 Finishing automation moved this from Needs Work to Done Oct 15, 2019
@splitbrain splitbrain deleted the fixMissingMetaCreator branch October 15, 2019 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants