Fixed vB4 With Blogs: InvalidArgumentException: Attempting to retain IDs when not possible

DragonByte Tech

Well-known member
The "Blogs: Parent node" config option says you should create a Category node for blogs to be imported into. However, when doing so and submitting the page, you get this:

Code:
InvalidArgumentException: Attempting to retain IDs when not possible in src/XF/Import/Manager.php at line 168

XF\Import\Manager->initializeNewImport() in src/XF/Admin/Controller/Import.php at line 118
XF\Admin\Controller\Import->displayStepConfig() in src/XF/Admin/Controller/Import.php at line 187
XF\Admin\Controller\Import->actionStepConfig() in src/XF/Mvc/Dispatcher.php at line 249
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1891
XF\App->run() in src/XF.php at line 328
XF::runApp() in admin.php at line 13

The description makes no mention of the fact that Retain IDs cannot be selected when you follow the instructions.

Furthermore, I think this node should be created automatically based on what you enter in this field, AFTER every other forum has been imported, so that retain IDs can be used.


Fillip
 
I have a feeling you were somehow using an older version of the importer when you reported this.

You imply that it's necessary to manually create a node, but if retain IDs is enabled, you actually create the node in the importer step UI:

1536160099426.webp

There's potentially a mistake in the explain text. I guess it's possible that you didn't realise this page would create the node for you?

Indeed if you created the node manually, it would cause the issue as described.

Can you confirm if any of this rings a bell? If so then I guess it's the misleading explain text which is the main bug.
 
I have a feeling you were somehow using an older version of the importer when you reported this.
I believe I would have been using whatever was the latest version at the time of reporting, from my downloaded files I was using v1.0.1a.

There's potentially a mistake in the explain text. I guess it's possible that you didn't realise this page would create the node for you?
That could very well be the case, from reading the text in the screenshot I would definitely have assumed that I needed to create a node first, then select that node on that page.

What is still unexplainable is how I managed to trigger that exception in the first place, I know I wouldn't have edited the HTML source to allow me to tick the Retain IDs box.

Could it be possible that v1.0.1a / whatever was the current version of XF2 back in the start of April had a bug where creating the node via that input box would trip up the canRetainIds check (and/or that this potential bug still exists)?


Fillip
 
There wouldn't have been anything to prevent you from clicking the retain IDs checkbox. That would have been shown prior to the step configuration where the blog stuff is configured.

So you would have clicked Retain IDs as you intended, and then got the above screen and then have gone back to create the node as the explain text asks you to. After doing that, at the point at which we verified retain IDs would be usable, there would now be a third node which (rightly) makes the retain IDs verification fail as having the extra node would indicate that there may be existing content in the database.

So the mistake seems to be entirely in the explain text. We've changed the explain text to:
vBulletin blogs will be imported as threads. Type the desired name of a new node into which these threads should be inserted.
I think the text displayed in my screenshot is actually from an older implementation and we forgot to update it.

I think we can call this fixed, on that basis.
 
Back
Top Bottom