Resave posts all

Resave posts all [Paid] 1.7

No permission to buy ($35.00)

AndyB

Well-known member
AndyB submitted a new resource:

Resave posts all - Allows resaving all posts to fix BB code issues after an import.

Premium upgrade:

This XF2 add-on along with the entire collection can be purchased for $35.00 USD. Your Premium upgrade will allow you to download as many XF2 add-ons as you like for one year. Please see the entire collection located in the Resources area at this URL:

https://www.xf2addons.com/

Description:

Allows resaving all posts to fix BB code issues after an import.

If after an import from another forum software you have posts which contain raw URLs, for...

Read more about this resource...
 
This is neat, I have some URLs as text with no bbcode that this can fix, however does this make every post say edited, or show in the edit log? (hopefully not)
 
Last edited:
Q: Is the Last edited by notice updated?
A: No. All Last edited by notices are removed in every post.


It might be good if it could leave already intact edited by notices. Not sure if it does already.

Suggestion: My suggestion is to be able to run this per thread id so we can test (or decide to run on) a long thread with different exposed bbcode, instead of multiple single posts. Thanks!
 
Last edited:
This wipes out ALL previous edits and clears the log for the posts affected. It should only remove (or not record) the edit made by this add-on. Can this be fixed?
 
I got the following error:

Screenshot 2023-08-06 164646.png

Server error log
  • TypeError: XF\Util\Url::urlToUtf8(): Argument #1 ($url) must be of type string, null given, called in /home/almalinux/public_html/src/XF/BbCode/ProcessorAction/AutoLink.php on line 430
  • src/XF/Util/Url.php:50
  • Generated by: Unknown account
  • 6 August 2023 at 4:40 PM

Stack trace​

#0 src/XF/BbCode/ProcessorAction/AutoLink.php(430): XF\Util\Url::urlToUtf8(NULL, false)
#1 src/XF/BbCode/ProcessorAction/AutoLink.php(149): XF\BbCode\ProcessorAction\AutoLink->unfurlLinkUrl('https://www.red...')
#2 [internal function]: XF\BbCode\ProcessorAction\AutoLink->XF\BbCode\ProcessorAction\{closure}(Array)
#3 src/XF/BbCode/ProcessorAction/AutoLink.php(146): preg_replace_callback('#^(?<=[^a-z0-9@...', Object(Closure), '
https://www.re...')
#4 src/XF/BbCode/Processor.php(377): XF\BbCode\ProcessorAction\AutoLink->filterString('
https://www.re...', Array, Object(XF\BbCode\Processor))
#5 src/XF/BbCode/Processor.php(360): XF\BbCode\Processor->filterString('
https://www.re...', Array)
#6 src/XF/BbCode/Traverser.php(67): XF\BbCode\Processor->renderString('
https://www.re...', Array)
#7 src/XF/BbCode/Processor.php(336): XF\BbCode\Traverser->renderSubTree(Array, Array)
#8 src/XF/BbCode/Processor.php(315): XF\BbCode\Processor->renderValidTag(Array, Array)
#9 src/XF/BbCode/Processor.php(264): XF\BbCode\Processor->filterTag(Array, Array)
#10 src/XF/BbCode/Traverser.php(63): XF\BbCode\Processor->renderTag(Array, Array)
#11 src/XF/BbCode/Processor.php(336): XF\BbCode\Traverser->renderSubTree(Array, Array)
#12 src/XF/BbCode/Processor.php(315): XF\BbCode\Processor->renderValidTag(Array, Array)
#13 src/XF/BbCode/Processor.php(264): XF\BbCode\Processor->filterTag(Array, Array)
#14 src/XF/BbCode/Traverser.php(63): XF\BbCode\Processor->renderTag(Array, Array)
#15 src/XF/BbCode/Processor.php(336): XF\BbCode\Traverser->renderSubTree(Array, Array)
#16 src/XF/BbCode/Processor.php(315): XF\BbCode\Processor->renderValidTag(Array, Array)
#17 src/XF/BbCode/Processor.php(264): XF\BbCode\Processor->filterTag(Array, Array)
#18 src/XF/BbCode/Traverser.php(63): XF\BbCode\Processor->renderTag(Array, Array)
#19 src/XF/BbCode/Traverser.php(39): XF\BbCode\Traverser->renderSubTree(Array, Array)
#20 src/XF/BbCode/Traverser.php(22): XF\BbCode\Traverser->renderAst(Array, Object(SV\AdvancedBbCodesPack\XF\BbCode\RuleSet), Array)
#21 src/XF/Service/Message/Preparer.php(164): XF\BbCode\Traverser->render([invalid], Object(SV\AdvancedBbCodesPack\XF\BbCode\Parser), Object(SV\AdvancedBbCodesPack\XF\BbCode\RuleSet), Array)
#22 src/XF/Service/Message/Preparer.php(129): XF\Service\Message\Preparer->processMessage([invalid])
#23 src/addons/XFMG/XF/Service/Message/Preparer.php(11): XF\Service\Message\Preparer->prepare([invalid], false)
#24 src/addons/SV/UserMentionsImprovements/XF/Service/Message/Preparer.php(37): XFMG\XF\Service\Message\Preparer->prepare([invalid], false)
#25 src/addons/SV/AdvancedBbCodesPack/XF/Service/Message/Preparer.php(32): SV\UserMentionsImprovements\XF\Service\Message\Preparer->prepare([invalid], false)
#26 src/XF/Service/Post/Preparer.php(98): SV\AdvancedBbCodesPack\XF\Service\Message\Preparer->prepare([invalid], false)
#27 src/addons/SV/UserMentionsImprovements/XF/Service/Post/Preparer.php(26): XF\Service\Post\Preparer->setMessage([invalid], true, false)
#28 src/XF/Service/Post/Editor.php(129): SV\UserMentionsImprovements\XF\Service\Post\Preparer->setMessage([invalid], true, false)
#29 src/addons/Andy/ResavePostsAll/Job/ResavePostsAll.php(96): XF\Service\Post\Editor->setMessage([invalid])
#30 src/XF/Job/AbstractRebuildJob.php(42): Andy\ResavePostsAll\Job\ResavePostsAll->rebuildById(223)
#31 src/XF/Job/Manager.php(260): XF\Job\AbstractRebuildJob->run(8)
#32 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#33 src/XF/Job/Manager.php(153): XF\Job\Manager->runJobEntry(Array, 8)
#34 src/XF/Cli/Command/JobRunnerTrait.php(32): XF\Job\Manager->runUnique('xfRebuildJob-re...', 8)
#35 src/XF/Cli/Command/JobRunnerTrait.php(15): XF\Cli\Command\Rebuild\AbstractRebuildCommand->runJob('xfRebuildJob-re...', Object(Symfony\Component\Console\Output\ConsoleOutput))
#36 src/XF/Cli/Command/Rebuild/AbstractRebuildCommand.php(96): XF\Cli\Command\Rebuild\AbstractRebuildCommand->setupAndRunJob('xfRebuildJob-re...', 'Andy\\ResavePost...', Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#37 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\Rebuild\AbstractRebuildCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#38 src/vendor/symfony/console/Application.php(992): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#39 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Andy\ResavePostsAll\Cli\Command\Rebuild\ResavePostsAll), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#40 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#41 src/XF/Cli/Runner.php(111): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#42 cmd.php(15): XF\Cli\Runner->run()
#43 {main}


Request state​

array(1) {
["cli"] => string(33) "cmd.php xf-rebuild:resavepostsall"
}


Code:
[root@hello]# php cmd.php xf-rebuild:resavepostsall
Rebuilding... Resave posts all (112)
Rebuilding... Resave posts all (183)

In Url.php line 50:

  XF\Util\Url::urlToUtf8(): Argument #1 ($url) must be of type string, null given, called in /home/almalinux/public_html/todo.2029.ws/src/XF/BbCode/ProcessorAction/AutoLin
  k.php on line 430


In Url.php line 50:

  XF\Util\Url::urlToUtf8(): Argument #1 ($url) must be of type string, null given, called in /home/almalinux/public_html/todo.2029.ws/src/XF/BbCode/ProcessorAction/AutoLin
  k.php on line 430


xf-rebuild:resavepostsall [--log-queries LOG-QUERIES] [-b|--batch BATCH] [--resume]

[root@hello]#
 
That was my suggestion privately. I'm glad it is now added. Great for fixing issues that exist pre-migration but you don't want to touch the new posts. For those that decide to fix issues even years later. Thanks!
 
Now requires closing board before add-on can run.
I was able to run it with this on.
Now requires the following two Options to be disabled before the add-on can be run: Enable edit log display after and Enable edit history and prune after.
I was able to run it with these on.

I stopped it from running, but it does run with these ON.
Version 1.6.
 
Can you add a thread ID field so we can do this for one thread only, as an option? Some forums have megathreads with visible YouYube urls that go back years, but we may not want to run this on the entire site.
 
Back
Top Bottom