Extension talk:Duplicator

From mediawiki.org
Latest comment: 3 years ago by Tinss in topic Issues Using Duplicator on Mediawiki 1.34

Success message links don't work[edit]

I'm finding that when I duplicate a page, although the code is there to create a link to the new page, it isn't actually converted into a link, and so the only way to navigate to the new page is to manually copy its name and change the URL. This is not ideal for non-technical users.

Here's what the success message looks like for me on MW 1.27.1 (no spaces between the brackets because, ironically, they aren't converted into real links):

[ [Page 1] ] was copied to [ [Page 2] ]. 1 { { PLURAL:1|revision was|revisions were } } copied.

  • I have the same problem with MW 1.29 .

[[User:Bmrberlin| Bernd M.]] (talk) 04:58, 26 July 2017 (UTC)Reply

Screenshot request[edit]

It would be handy to see what the history of the duplicated article looks like. Jayvdb 06:08, 28 July 2007 (UTC)Reply

It simply looks like the old history, but with an additional entry at the top stating "Copied from Page" Mike.lifeguard 04:24, 21 March 2008 (UTC)Reply

permissions[edit]

Is it possible to restrict this by permission? Mike.lifeguard 04:22, 21 March 2008 (UTC)Reply

Yes, it uses the duplicate permission.  — Mike.lifeguard | @meta 02:25, 6 October 2008 (UTC)Reply

How to remove the link in the TOOLBOX ?[edit]

How to remove the link in the TOOLBOX ? almaghi 15:44, 28 September 2009 (UTC)Reply

Should there be a parameter to disable :
/**
 * Extension setup function
 */
function efDuplicator() {
    global $wgHooks;
    $wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = 'efDuplicatorNavigation';
    $wgHooks['MonoBookTemplateToolboxEnd'][] = 'efDuplicatorToolbox';
}

Adding a Copy or Duplicate link to the article top options (where watch, delete, edit are)[edit]

I know its possible and i've tinkered around trying to do this but I can only get a link that points to the root URL of my wiki. It needs to be appended with Special:Duplicate/<Pagename> so that the duplicate form has the source field pre-populated... Can anyone suggest how to add the additional link cleanly... I have been editing the Duplicate.php by adding in a new class CopyAction invoked at the end with CopyAction::init();

just really struggling to assemble the href destination in php (i'm newish to php!)

update... Ok... made the optionbar addition... thanks to some forum posting i eventjually tracked down...

next issue... can the extension be tweaked slightly to allow for optional copy of the document version history... e.g. take a snapshot of just the latest version ! — Preceding unsigned comment added by Robski~mediawikiwiki (talkcontribs) 16:28, 12 January 2010‎ (UTC)Reply

extension to the editor[edit]

I'm the maker of the GoogleTranslate extension. I thus wonder if we could make this extension cooperate with the Template:Language and the my translator.

Roughly this would look like:

  • A new special edit button to the editor
  • Button checks for existing page in the (pre)selected languages.
  • Creates the page and adds the "Template:Language" to both the pages....
  • In case the page does not exist in the specified languages it should be created....
  • * suggest page names etc.??

Further, maybe the duplication could then be made to handle a range of pages. That is I have about 400 pages(!!), that I would like to "process" in this way....

Thus the advanced version of this would possibly make a "temporary translated version" as a sub-page to the to-be final language specific page. This page can the be promoted to be the final page, when someone has made the review edit. — Preceding unsigned comment added by 87.59.237.40 (talkcontribs) 18:41, 25 June 2010‎ (UTC)Reply

Warning when duplicating an article[edit]

I just got a warning, when I tried to duplicate an article and its talk page:

Strict Standards: Only variables should be passed by reference in [...]Duplicator.page.php on line 105

Both pages were duplicated just as expected. No problems there, but this warning was printed twice, before the actual content of the page was (including the opening html-element)

Before any problems occur because some lines are added or removed from the code and the line number does not fit anymore, here is line 105 in the Duplicator.page.php I am using:

if( $this->duplicate( $this->sourceTitle->getTalkPage(), $this->destTitle->getTalkPage() ) ) {

It is in the function execute.

I am running MediaWiki 1.17.0 with PHP 5.3.5 (apache2handler) and Duplicator 1.2.

Again this is nothing serious, the extension itself works just as expected. I just wanted to let you know about it. --Frog23 14:29, 5 October 2011 (UTC)Reply

German mediawiki Version 1.22.6[edit]

The extension does not copy the exact content of a page. Instead it puts the __DISAMBIG__ in. That makes the extension kind of useless, because you have to copy the content again. Example: http://rockinberlin.de/index.php?title=Test2 Any hints, how to prevent his? --[[User:Bmrberlin| Bernd M.]] (talk) 10:57, 9 April 2015 (UTC)Reply

Could this extension be made ready for usage on Wikimedia wikis?[edit]

This extension is mentioned as a possible solution to phab:T120783 ("Allow copy of pages"), a Community Wishlist item.

I see an old comment from 2007 (phab:T10833#127614) that raises concerns about "history duplication without any of the linking metadata that would make it manageable."

I'm wondering if those issues might have been addressed at all, in later versions of this extension?

Is anyone actively working on this extension, currently?

Thanks! Quiddity (WMF) (talk) 20:09, 9 September 2016 (UTC)Reply

Gives a warning on on MW 1.29.1[edit]

Gives a warning on on MW 1.29.1, Warning: Parameter 1 to efDuplicatorToolbox() expected to be a reference, value given in ...\wiki\includes\Hooks.php on line 186 --Rob Kam (talk) 23:16, 12 September 2017 (UTC)Reply

I suggest to create a task on Phabricator for this if this is still the case for 1.31.x. Cheers --[[kgh]] (talk) 09:41, 13 March 2019 (UTC)Reply

Duplicated pages don't show up as Recent changes[edit]

It's the simplest extensions that are the best. I love this extension. I just upgraded to the master version of this extension in my MW-1.28.2 private enterprise site to get the fix where, after duplicating the pages, it provides working links to both the source and destination pages. W00t! .. The only thing missing through is that duplicated pages don't show up in the "Special:RecentChanges" pages. Is that an easy fix for the owner of this extension? Hope so. --- User:revansx

I suggest to create a task on Phabricator for this. Cheers --[[kgh]] (talk) 09:41, 13 March 2019 (UTC)Reply

duplicated pages have the "created by" property of the source page[edit]

when visiting the history of a duplicated page, the page creator (and first edit) is listed as the creator/author of the page that was duplicated rather than the user who performed the duplication. Is this the intended behavior?

This is a problem for me when also using Extension: categorywatch in that when duplicating a page that is in a watched category, notification get sent out on behalf of the creator of the original page, rather than the user who did the duplication as would be expected. Revansx (talk) 21:38, 30 January 2019 (UTC)Reply

I suggest to create a task on Phabricator for this. Cheers --[[kgh]] (talk) 09:40, 13 March 2019 (UTC)Reply

Issues with MediaWiki 1.32[edit]

All, has anyone else had issues with Duplicator and MediaWiki 1.32? I recently tried to duplicate a page and got an Internal Error with a traceback that can be seen here: https://www.mediawiki.org/wiki/Topic:Uvk534c3g65obfzp

Indeed as far as the wikiapiary says, I might be the first Mediawiki 1.32 site to try Duplicator?

Please let us know what becomes of this. I'm eager to upgrade my mw1.30 site to 1.32 and Duplicator is a big part of how my users use my site. Revansx (talk) 22:00, 12 March 2019 (UTC)Reply


Yes, had issues also on 1.32, created a right mess, as the duplicated page was there, but didn't seem to exist in the DB, had to force delete the failed duplication to tidy up.

Just re-tested now to remind myself, got the following when doing the duplication - "Internal error - [XIjMhF@T27P4Hc-2jIsVpQAAAA8] 2019-03-13 09:25:25: Fatal exception of type "MediaWiki\Revision\RevisionAccessException""

When trying to visit the duplicated (failed) page, VisualEditor says "Error loading data from server: latestnotfound: Could not find latest revision for title. Would you like to retry?"

Source edit says "The revision #0 of the page named "TOPL Test" does not exist. This is usually caused by following an outdated history link to a page that has been deleted. Details can be found in the deletion log." --Freekycheese (talk) 09:37, 13 March 2019 (UTC)Reply

Tracked with task T218096 --[[kgh]] (talk) 09:39, 13 March 2019 (UTC)Reply

not Duplicator copy[edit]

MediaWiki 1.33.0 (7a3f860)
PHP 7.2.22 (cgi-fcgi)
MariaDB 10.3.18-MariaDB
ICU 64.1
Lua 5.1.5

[XYtBGf4qO5tFANELvYHIIQAAAAE] /wiki/%D9%88%DB%8C%DA%98%D9%87:Duplicator Error from line 1384 of /home/wikicod/domains/wikicod.ir/public_html/w/includes/page/WikiPage.php: Call to a member function getId() on null

Backtrace:

  1. 0 /home/wikicod/domains/wikicod.ir/public_html/w/includes/page/Article.php(2793): WikiPage->updateRevisionOn(Wikimedia\Rdbms\DatabaseMysqli, NULL, NULL, NULL)
  2. 1 /home/wikicod/domains/wikicod.ir/public_html/w/extensions/Duplicator/Duplicator.page.php(339): Article->updateRevisionOn(Wikimedia\Rdbms\DatabaseMysqli, NULL)
  3. 2 /home/wikicod/domains/wikicod.ir/public_html/w/extensions/Duplicator/Duplicator.page.php(115): SpecialDuplicator->duplicate(Title, Title, boolean)
  4. 3 /home/wikicod/domains/wikicod.ir/public_html/w/includes/specialpage/SpecialPage.php(569): SpecialDuplicator->execute(NULL)
  5. 4 /home/wikicod/domains/wikicod.ir/public_html/w/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
  6. 5 /home/wikicod/domains/wikicod.ir/public_html/w/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
  7. 6 /home/wikicod/domains/wikicod.ir/public_html/w/includes/MediaWiki.php(865): MediaWiki->performRequest()
  8. 7 /home/wikicod/domains/wikicod.ir/public_html/w/includes/MediaWiki.php(515): MediaWiki->main()
  9. 8 /home/wikicod/domains/wikicod.ir/public_html/w/index.php(42): MediaWiki->run()
  10. 9 {main}

thankyou

2020-03-30: Downloaded the latest from their Git however: Bug still exists, plugin still seems incompatible with Mediawiki.1.33.  :-(

There is patch here: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Duplicator/+/591434 --Anysite (talk) 19:37, 21 April 2020 (UTC)Reply

Yes! The Patch works like a dream. Marco.wobben (talk) 17:54, 30 April 2020 (UTC)Reply

Glad to hear. --Anysite (talk) 12:16, 1 May 2020 (UTC)Reply

Issues Using Duplicator on Mediawiki 1.34[edit]

Hi All,

I've been using Duplicator for ages on 1.31 but then a while ago I upgraded to 1.34 and now duplicator is giving the following error:

[f6019b9f0305760d57bdc1b7] 2020-05-11 07:25:16: Fatal exception of type "Error"

And that's all. I can't find logs either. I've tried:

  1. Completely uninstalling the extension, re-installing and updating php using the pho update.php command
  2. Re-downloading and using Duplicator 1.34 version (I did notice afterwards that the extension mentions it works with MW 1.28 - 1.31)
  3. Downloading v1.31 (even though I'm on MW v1.34, but worth a shot)
  4. Creating many different page names using duplicator (in case the name was already taken)

none of the above have worked, but I can't find log files or more information. Does anyone have any ideas or knowledge of where the logs are kept? Or does it simply not work because the version of MW I'm using is not that of the stated supported versions of Duplicator? We also use MW at work and currently that's on MW v1.32 and works a treat, but we're thinking of upgrading to the latest MW version soon and it'd be painful if we can no longer use it as we use Duplicator for creating pages based off "templates" I've created.

Thank you in advance for any advise provided.

I also use this extension and confirm that it is not functioning with MW 1.34 using either REL1_34 brnach or master. I'm not a savvy extension programmer, but I'm going to try to fix my version and submit a PR in github. No promises, but I'm in the same boat you are and need this extension to work in MW 34. So fingers crossed that it's not too complicated to solve and i'll let you know if I make and progress. cheers! - Revansx (talk) 13:08, 13 May 2020 (UTC)Reply

Here is the error it is throwing:

[XrvywEQ3fjCmX@bE5HauiwAAAAE] /test/Special:Duplicator Error from line 1394 of /opt/htdocs/mediawiki/includes/page/WikiPage.php: Call to a member function getId() on null

Backtrace:

#0 /opt/htdocs/mediawiki/includes/page/Article.php(2827): WikiPage->updateRevisionOn(Wikimedia\Rdbms\MaintainableDBConnRef, NULL, NULL, NULL)
#1 /opt/htdocs/mediawiki/extensions/Duplicator/Duplicator.page.php(333): Article->updateRevisionOn(Wikimedia\Rdbms\MaintainableDBConnRef, NULL)
#2 /opt/htdocs/mediawiki/extensions/Duplicator/Duplicator.page.php(114): SpecialDuplicator->duplicate(Title, Title, boolean)
#3 /opt/htdocs/mediawiki/includes/specialpage/SpecialPage.php(575): SpecialDuplicator->execute(NULL)
#4 /opt/htdocs/mediawiki/includes/specialpage/SpecialPageFactory.php(611): SpecialPage->run(NULL)
#5 /opt/htdocs/mediawiki/includes/MediaWiki.php(296): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#6 /opt/htdocs/mediawiki/includes/MediaWiki.php(900): MediaWiki->performRequest()
#7 /opt/htdocs/mediawiki/includes/MediaWiki.php(527): MediaWiki->main()
#8 /opt/htdocs/mediawiki/index.php(44): MediaWiki->run()
#9 {main}
Sadly, the Duplicator extension is no longer working past 1.32 due to a migration on how MW handles revisions. Someone needs to dig into the code to fix the extension. There is no workaround as far as I know. Tinss (talk) 18:45, 5 June 2020 (UTC)Reply
I suggest filing an issue report on Phabricator. The chances that someone reads this are regrettably even lower here than there. It will be cool if you could provide the task ID here once this is done. Thanks and cheers --[[kgh]] (talk) 14:31, 3 July 2020 (UTC)Reply
Done (task T212813) ! Tinss (talk) 23:25, 30 November 2020 (UTC)Reply

I have this working for 1.35.1.[edit]

I submitted the code and hoping they will merge with master. Task T275649.