• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
XenTag Importer

XenTag Importer 1.0

No permission to download

Tan Tran

Well-known member
#1
Tan Tran submitted a new resource:

XenTag Importer - Just another importer for TinhTe XenTag. XenForo 1.5 Only

I created this addon to import XenTag Tags on my community, it worked fine, so i would like to share here. It will import XenTag tags to XenForo 1.5 Tag system and also help to redirect old tags that indexed by search engines to new url (from (+) to (-) url).

Warning: This was created on XenForo 1.5 Beta. It should be used for testing in a Test Forum first.

How to use this importer?
- Backup your database before upgrading/installing new things.
-...
Read more about this resource...
 

otto

Well-known member
#4
I can you say it works. I have used it since second xf 1.5 Beta was out. (y)

But after Import - your Batch Updater for Tags is a realy useful addon. :)
 

imthebest

Well-known member
#5
I found a bug: the "Last Used" for each tag is being set to the date/time when they got imported.

Btw according to admin.php?tags/ I have 20,654 tags however at admin.php?xentag-tags/ I have 20,929 tags. How I can see which are those 275 unimported tags?
 
Last edited:

Tan Tran

Well-known member
#6
I found a bug: the "Last Used" for each tag is being set to the date/time when they got imported.
Thanks, i will resolve this issue in the next update.

Btw according to admin.php?tags/ I have 20,654 tags however at admin.php?xentag-tags/ I have 20,929 tags. How I can see which are those 275 unimported tags?
Currently, this plugin can't show unimported tags, but i think "Tag Length Limit" option (in XF 1.5) could be the problem, it should be set lower than the similar option of XenTag. When import XenTag, this addon will check all XenTag tags and ignore tags that don't follow XF 1.5 Content Tag Options.
 

clove28

Active member
#7
@Tan Tran

I got this error while rebuilding caches..

Argument 2 passed to XenForo_TagHandler_Tagger::setPermissionsFromContext() must be of the type array, boolean given, called in /public/library/XenTagImporter/Deferred/Thread.php on line 39 and defined

  1. XenForo_Application::handlePhpError() in XenForo/TagHandler/Tagger.php at line 33
  2. XenForo_TagHandler_Tagger->setPermissionsFromContext() in XenTagImporter/Deferred/Thread.php at line 39
  3. XenTagImporter_Deferred_Thread->execute() in XenForo/Model/Deferred.php at line 295
  4. XenForo_Model_Deferred->runDeferred() in XenForo/Model/Deferred.php at line 429
  5. XenForo_Model_Deferred->_runInternal() in XenForo/Model/Deferred.php at line 374
  6. XenForo_Model_Deferred->run() in XenForo/ControllerAdmin/Tools.php at line 159
  7. XenForo_ControllerAdmin_Tools->actionRunDeferred() in XenForo/FrontController.php at line 347
  8. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  9. XenForo_FrontController->run() in /home/nginx/domains/pefcommunity.com/public/admin.php at line 13
 

Tan Tran

Well-known member
#8
I got this error while rebuilding caches..

Argument 2 passed to XenForo_TagHandler_Tagger::setPermissionsFromContext() must be of the type array, boolean given, called in /public/library/XenTagImporter/Deferred/Thread.php on line 39 and defined
Please edit this file: XenTagImporter/Deferred/Thread.php

Find:
PHP:
$forum = $forumModel->getForumById($thread['node_id']);
Then replace it with:
PHP:
$forum = $forumModel->getForumById($thread['node_id']);
if (!$forum) {
       continue();
}
 

clove28

Active member
#9
Please edit this file: XenTagImporter/Deferred/Thread.php

Find:
PHP:
$forum = $forumModel->getForumById($thread['node_id']);
Then replace it with:
PHP:
$forum = $forumModel->getForumById($thread['node_id']);
if (!$forum) {
       continue();
}
Hi Tan,

Now I'm receiving a blank page..

EDIT: Now it's working. I didn't see the finished statement though. Error logged:

ErrorException: Fatal Error: syntax error, unexpected ')' - library/XenTagImporter/Deferred/Thread.php:39

One more question, can I safely uninstall the xentag after the import?
 
Last edited:

Tan Tran

Well-known member
#10
Because you were getting error, you should run the importer again. No worries, it is safe to run this importer one more time. And Double check your tags before uninstalling XenTag.
 

clove28

Active member
#11
Because you were getting error, you should run the importer again. No worries, it is safe to run this importer one more time. And Double check your tags before uninstalling XenTag.
Can I still use the Xentag with XenForo 1.5? The hash tagging is a must for my site.
 

ibrian

Well-known member
#16
It all seems to run fine - cheers for that.

However, I'm getting a warning in AdminCP:
There are manual rebuild processes that have been stopped before completion. Click here to complete them.
When I click the link - or, if I go to AdminCP > Tools > Rebuild Caches - I get the following error:

An exception occurred: Invalid model 'XenResource_Model_Resource' specified in /home/sffchrom/public_html/library/XenForo/Model.php on line 192

XenForo_Model::create() in XenTagImporter/Deferred/Resource.php at line 14
XenTagImporter_Deferred_Resource->execute() in XenForo/Model/Deferred.php at line 295
XenForo_Model_Deferred->runDeferred() in XenForo/Model/Deferred.php at line 429
XenForo_Model_Deferred->_runInternal() in XenForo/Model/Deferred.php at line 374
XenForo_Model_Deferred->run() in XenForo/ViewRenderer/Abstract.php at line 352
XenForo_ViewRenderer_Abstract::hasManualDeferredToRun() in XenForo/ViewRenderer/Json.php at line 147
XenForo_ViewRenderer_Json::_addDefaultParams() in XenForo/ViewRenderer/Json.php at line 185
XenForo_ViewRenderer_Json::jsonEncodeForOutput() in XenForo/ViewAdmin/Error/ServerError.php at line 47
XenForo_ViewAdmin_Error_ServerError->renderJson() in XenForo/ViewRenderer/Abstract.php at line 227
XenForo_ViewRenderer_Abstract->renderViewObject() in XenForo/ViewRenderer/Json.php at line 88
XenForo_ViewRenderer_Json->renderView() in XenForo/FrontController.php at line 601
XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
XenForo_FrontController->run() in /home/sffchrom/public_html/admin.php at line 13
 

Tan Tran

Well-known member
#17
It all seems to run fine - cheers for that.

However, I'm getting a warning in AdminCP:


When I click the link - or, if I go to AdminCP > Tools > Rebuild Caches - I get the following error:
Is XenResource installed at your community? if you don't use XenResource, please ignore "Import Resource Tags" feature.
 
Last edited:

ibrian

Well-known member
#18
Ah - hadn't realised that. Trouble is, I can no longer rebuild any cache - I keep getting the following error message:

Code:
Invalid model 'XenResource_Model_Resource' specified

[LIST=1]
[*]XenForo_Model::create() in XenTagImporter/Deferred/Resource.php at line 14
[*]XenTagImporter_Deferred_Resource->execute() in XenForo/Model/Deferred.php at line 295
[*]XenForo_Model_Deferred->runDeferred() in XenForo/Model/Deferred.php at line 429
[*]XenForo_Model_Deferred->_runInternal() in XenForo/Model/Deferred.php at line 374
[*]XenForo_Model_Deferred->run() in XenForo/ControllerAdmin/Tools.php at line 159
[*]XenForo_ControllerAdmin_Tools->actionRunDeferred() in XenForo/FrontController.php at line 347
[*]XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
[*]XenForo_FrontController->run() in /home/xxxxx/public_html/admin.php at line 13
[/LIST]
Do you think there's any way to correct the issue, please? :)

EDIT: Or should I be safe to just leave it until Google's crawled the replacement URLs, then disable both yours and Tinhe's tag plugins?

Just to be clear, it was great of you to provide this plugin and it worked really well for what it was supposed to it. The problem is just user error from me trying to get it to do something else!
 

Tan Tran

Well-known member
#19
That happened because the Deferred task - (Import Resource Tags) was executed but could not finish. We have to end it manually.
Open this file Library > XenTagImporter > Deferred > Resource.php

Then add this line at the begin of function execute(array $deferred, array $data, $targetRunTime, &$status)

PHP:
return false;
It will look like this:
PHP:
public function execute(array $deferred, array $data, $targetRunTime, &$status)
{
      return false; // Add this

      $data = array_merge(array(
       'batch' => 100,
       'position' => 0,
       'positionRebuild' => false
     ), $data);
           ....
Ok Save that file, and now visit your Admin Cp, click on the Error message to resume the Deferred task, it will return False and finish.