Jump to content

Acronym Expansion - external import

Featured Replies

Posted

I had a list already and imported that in fine into the relevant table. It all shows fine in the ACP and you can edit/delete/etc... But they don't seem to work on the forum. 

As I imported it, IPS are saying it's not supported and suggested I try here. Has anyone else tried to import content into the acronyms tables?

  • Author

Ok, just further on this, it seems to work fine on new posts. Any post/thread prior to an acronym being added won't show the expansion. Doesn't matter if it's my imported one or a newly created one.

Does anyone else have this issue?

Acronyms are only parsed at post time now where they are turned into the relevant html. You could probably trigger the task that rebuilds all legacy posts which may then process it, but I've not looked into it.

  • Author

That's what I thought but support haven't been forthcoming with what that task is? Was hoping someone here would know. I've tried a few of them already but will take another look at the list of tasks.

It's RebuildPosts because that calls the LegacyParser. Give me a minute on my test board to try something.

  • Author

How did I miss the obvious one lol I've got a test board as well I can try in when I get home.

I just added an acronym and ran this and it got processed.

<?php

require './init.php';

foreach ( \IPS\Content::routedClasses( FALSE, TRUE, TRUE ) as $class )
{
	try
	{
		\IPS\Task::queue( 'core', 'RebuildPosts', array( 'class' => $class ), 3, array( 'class' ) );
	}
	catch( \OutOfRangeException $ex ) { }
}

echo "Queued...";

I'd be slightly nervous about re-running RebuildPosts on live, but that's probably because I got burned with content loss on 4.0.1. I think the bugs I had in there have been fixed now.

  • Author

Where did you save that php file to? Forum root?

btw, there was no task called rebuild posts in ACP.

Yeah forum root - wherever init.php is. It's not a normal task. It's one of the internal background tasks that gets run sometimes after upgrades. There's no ACP way to initiate it. It's the one that took hours on the initial v3 to v4 upgrade. 

  • Author

Thank you so much for this, worked fine in dev so rolled it out in prod and now all is good.

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.