dokuwiki-plugin-sync
dokuwiki-plugin-sync copied to clipboard
TypeError while synchronizing
Hello everyone,
I have five Dokuwikis, which are synchronized to a second instance. This worked well for a long time, but now three of them suddenly report:
TypeError: strftime(): Argument #2 ($timestamp) must be of type ?int, IXR\DataType\Date given
...and stop syncing. The other two are doing fine. Is there any hint what I have to repair to resync the wikis again? The errors occur while syncing a pdf file (in two cases) or a png file (in one case).
CU, Patrick
Hello,
I am also a happy user of the Sync plugin so far.
But I am facing from a week (around...) the same error synchronizing two wiki (one distant, one on my computer) : TypeError: strftime(): Argument #2 ($timestamp) must be of type ?int, IXR\DataType\Date given
with a png file.
If I remove the png file (I thought it was somehow corrupted), I face the same issue with the following png file.
I have the feeling the issue raised when I upgraded to Release 2024-02-06a “Kaos”. Could this extension be not compatible with the last Dokuwiki release?
Any way to solve this issue :slightly_smiling_face: ?
I have no idea where it comes from, but with the latest updates installed, the timestamp given to the sync-process sometimes is not a timestamp as an integer but a IXR\DataType\Date object
the function strftime is deprecated anyway, So I replaced it with the date() function (potentially messing up the timezones (I'm not an expert here)).
So at the three occurrences of strftime I replaced it with something like this
Example line 609:
echo '<div>'.strftime($conf['dformat'],$item['remote']['mtime']).'</div>';
is replaced by:
if(is_object($item['remote']['mtime'])){
echo '<div>'.date('Y/m/d H:m',$item['remote']['mtime']->getTimestamp()).'</div>';
}else{
echo '<div>'.date('Y/m/d H:m',$item['remote']['mtime']).'</div>';
}
please note that dokuwiki seems to configure the dateformat for strftime()
and date()
uses a different syntax for the format string. So for now the format is simply hardcoded.
Here is my version of admin.php ... it's crude and hacky but works for now admin.zip
I confirm that the updated admin.php does the trick at this stage - many thanks! But, I also notice that many text files which have no differences are reported in the sync list with the centre radio button pre-chosen and the timestamps+sizes matching on screen. Subsequent syncs yield the same results. This is not the case for media (where only changed files are reported). I wonder if the two issues are related.
The last Update to the code is from 2 years ago. can I assume, the development of this plugin is dead?