1 --- dokuwiki-plugin-pagemove-20110811/admin.php~ 2012-06-12 23:48:17.000000000 +0300
2 +++ dokuwiki-plugin-pagemove-20110811/admin.php 2012-06-12 23:50:28.916910665 +0300
5 // Set things up to display the new page.
6 io_saveFile($conf['cachedir'].'/purgefile', time());
7 - $ID = $opts['new_id'];
10 - $this->show_form = false;
12 + // redirect to page display
13 + Header("Location: ".wl($opts['new_id']));
17 $this->errors[] = $this->lang['pm_fatal'];
19 saveWikiText($ID, '', $this->lang['pm_delete'] );
22 + // replace our old id with new one as we already renamed the page but
23 + // there might be backlinks (links to self in this case).
24 + $opts['id'] = cleanID($opts['ns'].':'.$opts['name']);
25 + $selfmod = isset($backlinks[$opts['id']]);
27 + $backlinks[$opts['new_id']] = $backlinks[$opts['id']];
28 + unset($backlinks[$opts['id']]);
31 // Loop through backlinks
32 foreach($backlinksById as $backlinkingId => $backlinks) {
33 - $this->_pm_updatebacklinks($backlinkingId, $backlinks, $opts, $brackets);
34 + $this->_pm_updatebacklinks($backlinkingId, $backlinks, $opts);
37 // Move the old revisions
38 $this->_pm_movemeta('olddir', '/^'.$opts['name'].'\.[0-9]{10}\.txt(\.gz)?$/', $opts);
40 + // remove cache. again if we ourselves were modified (due backlinks)
42 + $cache = new cache_instructions($opts['new_id'], wikiFN($opts['new_id']));
43 + $cache->removeCache();
50 * @author Gary Owen <gary@isection.co.uk>
52 - function _pm_updatebacklinks($backlinkingId, $links, $opts, &$brackets) {
53 + function _pm_updatebacklinks($backlinkingId, $links, $opts) {
56 // Get namespace of document we are editing
59 $this->_pm_updatelinks($text, $oid);
61 - // Save backlink and release lock
62 - saveWikiText($backlinkingId, $text, sprintf($this->lang['pm_linkchange'], $ID, $opts['new_id']));
63 + // Save backlink and release lock. call the edit minor to avoid mail flood on marge backlinks changes
64 + saveWikiText($backlinkingId, $text, sprintf($this->lang['pm_linkchange'], $ID, $opts['new_id']), 1);
65 unlock($backlinkingId);