Extension talk:Sync

About this board

Stonegaze (talkcontribs)

Hello @Nischayn22,

I followed your explanation and read readme.txt thoroughly.

But after completing all works in instruction, this error message is occurred.


"Deprecated: Use of $wgUser was deprecated in MediaWiki 1.35. [Called from MediaWiki\HookContainer\HookContainer::callLegacyHook in /opt/homebrew/var/www/mw/includes/HookContainer/HookContainer.php at line 338] in /opt/homebrew/var/www/mw/includes/debug/MWDebug.php on line 377

Deprecated: $"


I found that this error occurs when I load 'sync' extension.

I use ...

제품 버전
MediaWiki 1.38.4
PHP 8.1.11 (apache2handler)
MariaDB 10.8.3-MariaDB
ICU 71.1
Pygments 2.11.2

Could you help me?

Thank you.

p.s. Following your instruction, I found there is no composer.local.json in my mediawiki folder. So I edited composer.json.

Nischayn22 (talkcontribs)

Hi Stonegaze,

The extension might not work well with 1.38 and above MediaWiki versions. It will require some fixes to make it to work. Feel free to reach out to me for consulting.


Thanks.

2A01:599:447:F235:34A4:DC59:65C1:4269 (talkcontribs)

Hi,

I would also be interested in getting it to run under 1.38+. Did you work out any fixes that you could publicly share? I would be grateful :)

Best regars,

Reply to "Deprecated error"

How to test if it work ?

1
42.116.18.156 (talkcontribs)

Hi Nischayn22,

I am follow your instruction and no problem happen but i dont know how to test if it work.

I want to sync all content from wiki2.mydomain.com to old my wiki wiki1.mydomain.com, they are on same server but i can move to separate if need.

Thanks a lot.

Reply to "How to test if it work ?"
Gunnar.offel (talkcontribs)

Does the extension sync in both directions or "just" deliver the content in one direction, in meaning of deployment ?

Actually i would like to sync a live mediawiki and a local version for offline use (local developer station), so both directions would be necessary for this case.

Nischayn22 (talkcontribs)

It can only sync in one direction. You can install it on both the wikis for your use case.

Gunnar.offel (talkcontribs)

Thanks for the option. Sounds promissing, i will try that, but i assume the local version will have different IPs / locations so

$wgSyncWikis[] = array(
'api_path' => "http://yourwiki/wiki2",

must corrected each time. Maybe i write a script for this. Will see.

Reply to "to clarify"

"Mediawiki-Api" or "Mediawiki_Api"

2
Revansx (talkcontribs)
Nischayn22 (talkcontribs)

You need to use "nischayn22/mediawiki-api" in composer. Its the composer name for the same library.

Reply to ""Mediawiki-Api" or "Mediawiki_Api""

Errors upon save after install

1
Revansx (talkcontribs)

Installation seemed to have gone well. Synch shows up properly in Special:Version and pages render fine. I configured Synch as prescribed to synch to another wiki per my credentials, however, when I clicked "Save" after making some edits, the following appeared.

After refreshing the page I could see that the edit was indeed performed, however, the synch was not performed.

Reply to "Errors upon save after install"
Revansx (talkcontribs)

Nice extension! .. Questions:

  1. Is google/cloud-translate necessary to install?
  2. Would it still work if the wiki had no access to the outside world after installing? (In other words, if I don't want to translate, can I skip/omit the "google/cloud-translate" dependency?)
  3. Is Sync just WikiImporter with Google translate support? (In other words, if all I wanted was the sync capability without any language support, would WikiImporter be the right one to use?)
  4. Is this extension triggered by edits? or does it need to be run by a cron job or something?
This post was hidden by Revansx (history)
This post was hidden by Revansx (history)
Nischayn22 (talkcontribs)

Hi,

google/cloud-translate is not necessary for this to work and you can use it without enabling translate. I need to make this clearer to the documentation.

Sync is currently just wikiImporter but I plan to add live-sync i.e edits triggering sync in the next few days.

Revansx (talkcontribs)

I am super excited about that. Please do (live-sync).

I plan to test the extension today. Do you have any configuration guidance for someone implementing this on wikis that are all on the same server? such that they would all have addresses like http://127.0.0.1/wiki_A and http://127.0.0.1/wiki_B.

Nischayn22 (talkcontribs)

It uses the API so the addresses look fine.

Nischayn22 (talkcontribs)

I have added the live-sync, would be helpful if you can test it out. Do note that it takes a while for the pages to get updated for whatever reasons :/

Revansx (talkcontribs)

I'm going to wait until tomorrow when my server team can snapshot my system before I tinker. I'll let you know tomorrow afternoon.

Revansx (talkcontribs)

@Nischayn22, sorry for the delay in testing this extension. I'm still super eager to do so, but have not been able to get the dev time.. hoping to be able to test it next week.

Nischayn22 (talkcontribs)

Sure, no problem.

AlexeYreshetnyaK (talkcontribs)

@Nischayn22 Can I sync wikis if we have to log in for looking at content of articles?

Nischayn22 (talkcontribs)

Hi @AlexeYreshetnyaK, I am not sure what you meant. If you mean to say that one of the wiki is read restricted then I think this can still be done if you provide a login with the right credentials.

Revansx (talkcontribs)

@Nischayn22, I'm finally ready to test this extension. will provide feedback soon. Cheers!

Reply to "Questions"
208.81.12.35 (talkcontribs)

it states 1.25+ but im not sure that means it still functions with new versions.. has anyone tried this on mediawiki 1.32?


Revansx (talkcontribs)

I haven't used Sync yet, but it's high on my list of extensions to integrate into my site. I've been waiting until after I upgrade to 1.32 before I work with it. Please let us know here what your experience is with Sync on 1.32 and I'll do the same. Cheers!

208.81.12.35 (talkcontribs)

on trying to sync a page i get a blank screen except for this;

Unrecognized parameter: 'type'Unrecognized value for parameter 'meta': tokensFAILED: Reason :

and a api is not enabled message in the apache error log.

Interestignly the API is enabled on both source and target wiki's.. So still tryting to get past this.

Revansx (talkcontribs)

I'm sorry I don't have any specific insight to help yet. Please share any successes and failures you have here as they will no doubt help others trying to do what you're doing now.

Reply to "does this stil work?"
69.70.144.54 (talkcontribs)

Hello Nischayn22,

I installed this Extension but I get errors:


I get this one when we try to save a page:

Catchable fatal error: Object of class WikitestContent could not be converted to string in /data/www/wiki1.redacted.com/public_html/vendor/nischayn22/mediawiki-api/src/MediaWikiApi.php on line 1022


I get these four errors when using sync page:

Warning: simplexml_load_string(): Entity: line 1: parser error : Extra content at the end of the document in /data/www/wiki1.redacted.com/public_html/vendor/nischayn22/mediawiki-api/src/MediaWikiApi.php on line 450

Warning: simplexml_load_string(): s" pageid="16" title="Test Sandbox" contentmodel="wikitext" nochange="" /></api> in /data/www/wiki1.redacted.com/public_html/vendor/nischayn22/mediawiki-api/src/MediaWikiApi.php on line 450

Warning: simplexml_load_string(): ^ in /data/www/wiki1.redacted.com/public_html/vendor/nischayn22/mediawiki-api/src/MediaWikiApi.php on line 450

Warning: First parameter must either be an object or the name of an existing class in /data/www/wiki1.redacted.com/public_html/vendor/nischayn22/mediawiki-api/src/MediaWikiApi.php on line 1076

Warning: First parameter must either be an object or the name of an existing class in /data/www/wiki1.redacted.com/public_html/vendor/nischayn22/mediawiki-api/src/MediaWikiApi.php on line 1088


However I tested it on MediaWiki 1.30.0 (Yes I know; shame on me)


Do you think the problem is the version or something else?

Thank you!

Nischayn22 (talkcontribs)

Yes, this looks like a version problem. I guess the extension isn't compatible with MW 1.30.

69.70.144.54 (talkcontribs)

Alright!


I'll check back later to see if you have a new version up.


Thanks!


Reply to "Fatal error on save"
Summary by Toto987

composer require "nischayn22/mediawiki-api:dev-master"

Toto987 (talkcontribs)

Hi Nischayn22,

thank you for your extension. However i face a installtion problem.

I don't understand where the composer.local.json's "require" section is located and where exactly I have to paste your code.

In the moment I installed all the way till the end except for the *.json. In this configuration I get following error.

Error from line 16 of /var/www/mediawiki/extensions/Sync/Sync.hooks.php: Class 'Nischayn22\MediaWikiApi' not found

Thank You for your support

Nischayn22 (talkcontribs)

Hi, in your main directory run: composer require "nischayn22/mediawiki-api"

Hopefully that should work.

Toto987 (talkcontribs)

Hi,

thank you for this suggestion, however it is still same. After I hit publish changes I still get the following error.

[f143961b9df50bcb247da6af] /mediawiki/index.php?title=page&action=submit Error from line 16 of /var/www/mediawiki/extensions/Sync/Sync.hooks.php: Class 'Nischayn22\MediaWikiApi' not found

Backtrace:

#0 /var/www/mediawiki/includes/Hooks.php(177): SyncHooks::onPageContentSaveComplete(WikiPage, User, string, string, integer, NULL, NULL, integer, Revision, Status, boolean, integer)

#1 /var/www/mediawiki/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)

#2 /var/www/mediawiki/includes/page/WikiPage.php(1853): Hooks::run(string, array)

#3 [internal function]: WikiPage->{closure}(Wikimedia\Rdbms\DatabaseMysqli, string)

#4 /var/www/mediawiki/includes/libs/rdbms/database/Database.php(3664): call_user_func_array(Closure, array)

#5 /var/www/mediawiki/includes/deferred/AtomicSectionUpdate.php(35): Wikimedia\Rdbms\Database->doAtomicSection(string, Closure)

#6 /var/www/mediawiki/includes/deferred/DeferredUpdates.php(259): AtomicSectionUpdate->doUpdate()

#7 /var/www/mediawiki/includes/deferred/DeferredUpdates.php(210): DeferredUpdates::runUpdate(AtomicSectionUpdate, Wikimedia\Rdbms\LBFactorySimple, string, integer)

#8 /var/www/mediawiki/includes/deferred/DeferredUpdates.php(127): DeferredUpdates::execute(array, string, integer)

#9 /var/www/mediawiki/includes/MediaWiki.php(606): DeferredUpdates::doUpdates(string, integer)

#10 /var/www/mediawiki/includes/MediaWiki.php(575): MediaWiki::preOutputCommit(RequestContext, Closure)

#11 /var/www/mediawiki/includes/MediaWiki.php(877): MediaWiki->doPreOutputCommit(Closure)

#12 /var/www/mediawiki/includes/MediaWiki.php(524): MediaWiki->main()

#13 /var/www/mediawiki/index.php(42): MediaWiki->run()

#14 {main}

Nischayn22 (talkcontribs)

Are you sure you installed it in the main directory?

Toto987 (talkcontribs)

In the meantime the update.php script had an issue with the composer.json file.

It made me change the version of "nischayn22/mediawiki-api": "^1.0" to "1.0".

After this it reported no error.

The error above is still there.

Nischayn22 (talkcontribs)

Was able to solve the problem, you need to run this command instead:

composer require "nischayn22/mediawiki-api:dev-master"

Toto987 (talkcontribs)

Thank You, now it works. Although it works not with VisualEditor.

Thanks a lot.

There are no older topics