[pmwiki-users] MiniEdit seems to reset ctime

0 views
Skip to first unread message

ki...@kirpi.it

unread,
Mar 14, 2012, 4:54:05 AM3/14/12
to PmWiki Users
I recently found that ctime was reset on some of my pages.
After some investigation it seem clear that editing Mini with
MiniEdit, even dragging a single picture or editing a caption, will
reset ctime to Unix epoch.

By the way, Mini coupled with MiniEdit and DragDropMultiUpload make an
amazing tool for pictures, Petko :-)
Thanks!

Luigi
----
N.B. While trying to discover the ctime reset issue, I also tried Mini
reset (action=purgethumbs) but this does not create any problem.

_______________________________________________
pmwiki-users mailing list
pmwiki...@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Petko Yotov

unread,
Mar 14, 2012, 6:49:52 AM3/14/12
to PmWiki Users
ki...@kirpi.it writes:
> I recently found that ctime was reset on some of my pages.
> After some investigation it seem clear that editing Mini with
> MiniEdit, even dragging a single picture or editing a caption, will
> reset ctime to Unix epoch.

MiniEdit doesn't modify the 'ctime' or the 'time' page attributes. When a
page is saved, the regular PmWiki functions are used and the 'time'
attribute should be updated to the current time, but the 'ctime' attribute,
if it exists, will not be modified at all.

Note that some pages may not have a 'ctime' page attribute, for example
Main.HomePage and other pages coming with the core distribution, possibly
some RecentChanges etc.

Try to create a new page and check if it has a 'ctime' attribute before
using MiniEdit. Then edit the gallery with MiniEdit and if the 'ctime'
attribute actually disappears, I'll look into it, but I really don't see how
this could happen. Unless you have some other recipe which might do
something I haven't thought of yet.

Petko

ki...@kirpi.it

unread,
Mar 14, 2012, 10:20:58 AM3/14/12
to PmWiki Users
> Try to create a new page and check if it has a 'ctime' attribute before
> using MiniEdit. Then edit the gallery with MiniEdit and if the 'ctime'
> attribute actually disappears,

I just tried and create a new page: its ctime was fine.
Then tried to edit it by hand: again the value was retained and
properly kept and shown.
Then uploaded a picture and MiniEdit(ed) it caption.
Now ctime has disappeared from the page!

The fact that
ctime=
disappears from the page is proven by looking at the page file.

It is nonetheless worth mentioning that, in order to better work with
ctime in pagelists and make it editable from the page form, I set in
config.php
$FmtPV['$PageCreationDate'] = '@strftime("%d-%m-%Y at %R", $page["ctime"])';
as found in http://www.pmichaud.com/pipermail/pmwiki-users/2009-December/056265.html
and also
$ctimeDispFmt = '%d-%m-%Y alle %R';
include_once('cookbook/editformcustomfields.php');
as found in http://www.pmwiki.org/wiki/Cookbook/EditFormCustomFields


Is there any test more I can do to help solving the puzzle?
:-)

Luigi

ki...@kirpi.it

unread,
Mar 14, 2012, 10:55:42 AM3/14/12
to PmWiki Users
>  $ctimeDispFmt = '%d-%m-%Y alle %R';
>  include_once('cookbook/editformcustomfields.php');
> as found in http://www.pmwiki.org/wiki/Cookbook/EditFormCustomFields

...as well as added ctime: (:input e_ctime:) in Site/EditForm
Yet I fail to imagine that such edits might interfere with the core
issue of this thread.

Petko Yotov

unread,
Mar 14, 2012, 6:57:31 PM3/14/12
to PmWiki Users
You can understand if a problem comes from one or another recipe. If you
disable the editformcustomfields.php recipe, you will see that MiniEdit does
not delete the ctime attribute.

The two recipes are not completely compatible. A temporary fix would be to
add such a line before including editformcustomfields.php :

if($action == 'miniedit') $customFields_isActive['ctime'] = false;

Otherwise, the editformcustomfields.php recipe could be slightly tuned to
work with recipes which use the UpdatePage() core mechanism, like MiniEdit,
Flipbox, PmForm and maybe other recipes. It may refrain from deleting the
page attributes ctime or title if the page is not edited via the regular
edit form. Something like this could replace the lines 56-60:

if ($customFields_isActive['ctime']){
$requestVal = @$_REQUEST['ctime'];
if ($requestVal != '') {
$SaveProperties[] = 'ctime'; # THIS line moved
$aResult = strptime($requestVal, $ctimeDispFmt);

This could be done in many different ways, for example by checking
if(isset($_REQUEST['ctime']))

and I didn't look into the part dealing with the title attribute, so I'll
leave it to the author to decide if and what to do. At any rate, he has
provided a way to disable the recipe with the line I gave you at the top of
this message.

Petko

ki...@kirpi.it

unread,
Mar 15, 2012, 10:21:07 PM3/15/12
to PmWiki Users
> A temporary fix would be to add such a line
> before including editformcustomfields.php :
>
> if($action == 'miniedit') $customFields_isActive['ctime'] = false;

Yes, it all work as it should, now.
I do not understand "what" it does, but it works :-)

Thank you Petko!

Reply all
Reply to author
Forward
0 new messages