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

TypeError while synchronizing #75

Open
holyfive opened this issue Apr 5, 2024 · 5 comments
Open

TypeError while synchronizing #75

holyfive opened this issue Apr 5, 2024 · 5 comments

Comments

@holyfive
Copy link

holyfive commented Apr 5, 2024

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

@croulibri
Copy link

croulibri commented Apr 16, 2024

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 🙂 ?

@Schwuuuuup
Copy link

Schwuuuuup commented May 14, 2024

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.

@Schwuuuuup
Copy link

Here is my version of admin.php ... it's crude and hacky but works for now
admin.zip

@EpicureanDigitalEngineer

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.

@Schwuuuuup
Copy link

The last Update to the code is from 2 years ago. can I assume, the development of this plugin is dead?

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

No branches or pull requests

4 participants