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

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
1 participant
@micgro42
Collaborator

micgro42 commented May 23, 2018

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.

Michael Gro脽e
fix: workaround premature metadata generation on page save 馃悰
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 pushed a commit to cosmocode/dokuwiki-plugin-publish that referenced this pull request May 23, 2018

Michael Gro脽e
fix: don't prevent creator from a new page's metadata 馃悰
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 splitbrain/dokuwiki#2401

@micgro42 micgro42 referenced this pull request May 23, 2018

Merged

Fix dropping meta creator #121

micgro42 pushed a commit to cosmocode/dokuwiki-plugin-publish that referenced this pull request May 23, 2018

Michael Gro脽e
fix: don't prevent creator from a new page's metadata 馃悰
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 splitbrain/dokuwiki#2401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment