• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Bug
    • XF\PrintableException: Batch install error: BB code tags must be unique. The specified tag is already in use. src/XF/Mvc/Entity/Entity.php:1212

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: XF\PrintableException: Batch install error: BB code tags must be unique. The specified tag is already in use. src/XF/Mvc/Entity/Entity.php:1212

    • Issue Tools
      • View Changes
    1. issueid=6244 August 9, 2021 4:20 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      XF\PrintableException: Batch install error: BB code tags must be unique. The specified tag is already in use. src/XF/Mvc/Entity/Entity.php:1212

      Server error log

      XF\PrintableException: Batch install error: BB code tags must be unique. The specified tag is already in use. src/XF/Mvc/Entity/Entity.php:1212

      Stack trace

      #0 src/addons/vw/vw/_core/model/tag/xf2.php(276): XF\Mvc\Entity\Entity->save()
      #1 src/addons/vw/vw/_core/model/tag/vw.php(308): vw_Tag_Model_XF2->do_update('vw_category_tag', Array)
      #2 src/addons/vw/vw/_install/lib/common/vw.php(349): vw_Tag_Model->update('vw_category_tag', Array)
      #3 src/addons/vw/vw/_install/lib/common/xf2.php(81): vw_Install_Common_Controller->update_bbcodes(Array, Array)
      #4 src/addons/vw/vw/_install/lib/common/vw.php(295): vw_Install_Common_Controller_XF2->update_bbcodes(Array, Array)
      #5 src/addons/vw/vw/_install/lib/upgradepath/steps/final/xf2.php(35): vw_Install_Common_Controller->do_bbcode(Object(vw\vw\Setup\View))
      #6 src/addons/vw/vw/Setup.php(333): vw_Install_UpgradePath_Steps_Final_Controller_XF2->{closure}(Object(vw\vw\Setup\Caller\Upgrade), false)
      #7 src/addons/vw/vw/Setup.php(1062): vw\vw\Setup->vwRunStep('upgrade', Object(vw_Install_UpgradePath_Steps_Final_Controller_XF2) , Array, 2)
      #8 src/XF/Job/AddOnInstallBatch.php(297): vw\vw\Setup->upgrade(Array)
      #9 src/XF/Job/AddOnInstallBatch.php(89): XF\Job\AddOnInstallBatch->stepAction(Object(XF\Timer))
      #10 src/XF/Job/Manager.php(258): XF\Job\AddOnInstallBatch->run(8)
      #11 src/XF/Job/Manager.php(200): XF\Job\Manager->runJobInternal(Array, 8)
      #12 src/XF/Job/Manager.php(116): XF\Job\Manager->runJobEntry(Array, 8)
      #13 src/XF/Admin/Controller/Tools.php(120): XF\Job\Manager->runByIds(Array, 8)
      #14 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
      #15 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(SV\UserMentionsImprovements\XF\Admin\Controller\To ols), NULL)
      #16 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\UserMentionsImprovements\XF\Admin\Controller\To ols), NULL)
      #17 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
      #18 src/XF/App.php(2344): XF\Mvc\Dispatcher->run()
      #19 src/XF.php(512): XF\App->run()
      #20 admin.php(13): XF::runApp('XF\\Admin\\App')
      #21 {main}

      Request state

      array(4) {
      ["url"] => string(33) "/test2-xf/admin.php?tools/run-job"
      ["referrer"] => string(61) "/admin.php?tools/run-job"
      ["_GET"] => array(1) {
      ["tools/run-job"] => string(0) ""
      }
      ["_POST"] => array(3) {
      ["_xfRedirect"] => string(97) "/admin.php?add-ons/install-from-archive-complete&batch_id=25"
      ["_xfToken"] => string(8) "********"
      ["only_ids"] => string(27) "958,960,960,960,960,960,960"
      }
      }

      This is a XF1 to XF2.2 upgrade.
    Issue Details
    Issue Number 6244
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Install / Upgrade
    Status Duplicate
    Priority 3 - Loss of Functionality
    Affected Version 4.1.2
    Fixed Version (none)
    Milestone (none)
    Software DependencyXenForo 2.x
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)


    Page 1 of 2 12 Next LastLast


    1. August 10, 2021 10:29 AM
      pegasus pegasus is offline
      VaultWiki Team
      Possibly your vw_category_tag is not owned by one of the following addon_ids:
      - vaultwiki, vw/vw, vw/vwcustom

      Please check your xf_bb_code table:
      Code:
      SELECT * FROM xf_bb_code WHERE vw_varname = 'vw_category_tag'
      What is the value for addon_id? If it is not one of the above, it should be changed (vw/vwcustom is safest).

      If a tag is not owned by the correct addon_id, VaultWiki fails to fetch its existing tag name. In that case, VaultWiki will use the default tag name when reimporting the BB-Codes. If you already use the default tag name as a different BB-Code, then the reimport will fail with an error like this.
      Reply Reply  
    2. August 10, 2021 5:44 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      The result is two rows:
      cat and category. Category has addonid vw/vw and cat has none.
      Reply Reply  
    3. August 11, 2021 11:48 AM
      pegasus pegasus is offline
      VaultWiki Team
      vw_varname is supposed to be unique. If you have duplicates, you will need to remove them based on what you actually use.
      So you should delete either cat or category, and the one that is left must have its addon_id = 'vw/vwcustom':
      Code:
      UPDATE xf_bb_code
      SET addon_id = 'vw/vwcustom'
      WHERE vw_varname = 'vw_category_tag'
      If you have duplicates for other vw_varnames, you should take care of them as well. There is no way to handle this automatically since you have to pick the duplicate you want to keep. You can get a list of duplicates like so:
      Code:
      SELECT vw_varname, COUNT(bb_code_id) AS dupes
      FROM xf_bb_code
      GROUP BY vw_varname
      HAVING dupes > 1
      This seems like a duplicate of your previous report:
      https://www.vaultwiki.org/issues/6169/
      where I suggested that you should associate the CAT BB-Code with the VaultWiki add-on. Judging by your stated SELECT result, this task must not have been completed at the time, probably because it seemed like that upgrade already finished. In that case, I would expect the behavior you reported during your second upgrade since then:
      1. First upgrade: VaultWiki add-on owns no vw_category_tag, so it creates one. This probably succeeds if this is the initial upgrade under XenForo 2, because it requires that XF\Entity\BbCode is not a vw\vw\XF\Entity\BbCode yet (or the same error from the other report would prevent the duplicate).
      2. Second upgrade: With two tags having vw_category_tag, the upgrade starts updating category but ends up updating cat, using the existing tag name of category. Since category is already category, we can't change cat to category too. Hence this error.
      Reply Reply  
    4. August 11, 2021 5:33 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      IIRC then NuWiki and later VW used to have cat bbcode. Then VW got new category functionality to add category through UI. Correct me if I am wrong, but IIRC VW introduced category bb code at that time causing my site to have 2 bbcodes for the same.
      So what I wonder about now is how do I check how often both of these bbcode are used in my wiki? What tables do I need to check?
      And can I simply replace all instances of one of those, with the other without any issues?
      Reply Reply  
    5. August 11, 2021 6:37 PM
      pegasus pegasus is offline
      VaultWiki Team
      Judging by your previous report, CAT is the name of your historical vw_category_tag (you renamed it from "category" many years ago). But for some reason it was not associated with the VaultWiki add-on (no way to know why at this point - would have required someone to notice when it originally happened). Because of this, when you upgraded to XenForo 2, the BB-Code was thought to be missing, so the upgrade process created the default name "category". I can't imagine that it happened at any other time because VaultWiki checks for duplicates if it is active, and because you would have already had this error the very first time you upgraded with 2 vw_category_tags. So I think it is completely safe to delete "category". If you have "category" used anywhere, you can safely change the usage to "cat" since they are both functionally the same BB-Code (vw_category_tag).

      There is no way to check how often only one of BB-Codes is used (they would be recorded as the same BB-Code since they are both vw_category_tag). You could do a mass replace (using Mass management tools) of all
      Code:
      \[category\](.*)\[/category\]
      to
      Code:
      [cat]$1[/cat]
      but I don't believe you need to do this. The tag is only used inside templates, to add categories to pages that use the template, and the categories need to be approved on a page-by-page basis. If this is a process you're not familiar with, then I doubt it is being used. If you are familiar with it, you can find out some that templates use vw_category_tag generally:

      Go to Special:WantedCategories. This will show you your choice of categories that do/don't exist, if those categories are trying to be added by a template. The link on the "members" will show you which pages want those categories. And the parentheses next to each page should show you the template that it came from. You can then check the template for category vs cat.
      Reply Reply  
    6. August 11, 2021 8:10 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      The xf1 version of the site also has both bbcodes. (Im testing the XF2 upgrade for my main site)
      Special:WantedCategories does not list anything.
      When I use mass management tools to search for:
      Code:
      [category](.*)[/category]
      Then I get a mass of results. Does this mean that this is in pretty much all pages?
      Reply Reply  
    7. August 12, 2021 10:10 AM
      pegasus pegasus is offline
      VaultWiki Team
      No, as mentioned before, mass management tools lists all pages that match the search criteria. It does not list pages based on the replacement rules. The replacement rules are applied in a later step.
      Reply Reply  
    8. August 12, 2021 1:55 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      If I try to delete the category bbcode in XF1 I get this error:

      This BB-Code performs special functionality through VaultWiki and cannot be removed, but you may rename it. If you are trying to create another BB-Code with this name, rename this BB-Code tag before creating the new tag.
      Reply Reply  
    9. August 12, 2021 6:07 PM
      pegasus pegasus is offline
      VaultWiki Team
      You should delete the extra BB-Code via MySQL.
      Code:
      DELETE FROM xf_bb_code WHERE bb_code_id = 'category'
      Reply Reply  
    10. August 12, 2021 7:27 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      That lead to unexpected results. Please see the main wiki page on my main site. Its filled with a mass of random [cat] linked wordsoup.
      All my articles are like this.
      It seems to have been caused by the mass replacement tool query above. Its the last revision that was automatically added some hours ago that added the it. Is there any way to revert all wiki edits in the last hours?
      Reply Reply  
    11. August 12, 2021 9:25 PM
      pegasus pegasus is offline
      VaultWiki Team
      I'm guessing that the find code needed to be escaped:
      Code:
      \[category\](.*)\[/category\]
      I think the previous regex was actually matching any number of characters, as long as those characters are surrounded on each side by a c, a, t, e, g, o, r, or y, or also a / on the right side.

      I would be surprised if this wordsoup was not apparent in any replacement previews. I recommend to always review a few previews carefully before approving a mass edit.

      You can mass undo edits using Mass management tools, but the time gate field is currently missing so it won't roll anything back as-is. To fix this, edit src/addons/vw/vw/_core/view/cp/massive/vw.php. Find:
      Code:
      				$html .= vw_Hard_Core::view('CP')->print_number_row(
      					vw_Hard_Core::view('Phrase')->get('vw_massive_rollback_total'),
      					vw_Hard_Core::view('Phrase')->get('vw_massive_rollback_total_desc'),
      					'edittotal',
      					isset($controller->massive['edittotal']) ? $controller->massive['edittotal'] : 1
      				);
      AFTER it, add:
      Code:
      				$minutes = 1;
      
      				if (isset($controller->massive['edittime']))
      				{
      					$timenow = vw_Hard_Core::controller('Request')->timenow();
      					$diff = $timenow - $controller->massive['edittime'];
      					$minutes = intval($diff / 60);
      				}
      
      				$html .= vw_Hard_Core::view('CP')->print_number_row(
      					vw_Hard_Core::view('Phrase')->get('vw_massive_rollback_minutes'),
      					vw_Hard_Core::view('Phrase')->get('vw_massive_rollback_minutes_desc'),
      					'editminutes',
      					$minutes ? $minutes : 1
      				);
      The field won't have phrases, but obviously you should enter the number of minutes to look back in history, and it will roll back up to X edits (a total you choose) as long as it's still in that time period.
      Reply Reply  
    12. August 13, 2021 5:08 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      I added it to: /library/vw/_core/view/cp/massive/vw.php
      Then selected 1 edit to undo and the required number of minutes. (2880 for 2 days) The results was all pages. But on preview, I see the erroneous version. I went ahead anyway, but no result. The pages are still the same.
      Reply Reply  
    13. August 14, 2021 11:56 AM
      pegasus pegasus is offline
      VaultWiki Team
      When I try this on the demo, the preview shows the expected rollback result. When I confirm the changes, the pages are rolled back as expected with the results from the preview. Trust the preview. My only thoughts are that:

      1. You possibly received an instant notification of my reply above, and applied the edit laid out in the notification, rather than the edit from my post update less than 1 minute later (like if you edited based on an email without visiting this site to get the edit)... Especially if you are reading the notification a while after it was sent, you should always check the website in case I have modified my response. I sometimes need to do several small changes to my posts in the first 1-2 minutes, either for formatting because vBulletin Project Tools doesn't have post previews, or because I have done further testing and determined a slightly different edit was needed, or because I don't like to double-post. Generally I assume this is safe as long as the user I'm responding to is not online or has not replied yet. (I edited the post you are reading 4 times already). If you edited based on notification content, please review my post above to double-check that the code you have matches the code above.

      2. OR Something is wonky about your server's clock, and 2880 minutes was actually not long enough to reach the edits you want to reverse.

      Note also, that in my testing there were a number of E_NOTICEs thrown by the preview action. You should be able to ignore these, as they are not critical and are already fixed in the next release.
      Reply Reply  
    14. August 15, 2021 12:40 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      I think that number 1 was indeed the case. I have gotten a fresh version of the file from the download zip and edited that and uploaded it.
      As there had not been any significant wiki updates i decided to rollback an extra day and used 5760 minutes. I reviewed the changes without applying them. The preview still showed the word soup. I also tried with a maximum of 2 edits to undo, but the preview showed the same. I did not apply the edit reversal.

      I checked my server time and its 1629045345 which is only 2 minutes off.

      You have full access to my main site. Can you find the issue?
      Reply Reply  
    15. August 21, 2021 4:13 PM
      pegasus pegasus is offline
      VaultWiki Team
      I have successfully rolled back all pages 10 days, eliminating the word soup. The problem was that it was trying to roll back TO an edit within the time frame, rather than FROM an edit within the time frame. So it was remaining unchanged when cutting the date right before the unwanted edit. I have updated the logic (FROM not TO) on your site and in the next release.
      Reply Reply  
    Page 1 of 2 12 Next LastLast
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 9:25 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.