Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import from old categories #62

Closed
sbusemann opened this issue Jan 12, 2018 · 0 comments
Closed

Import from old categories #62

sbusemann opened this issue Jan 12, 2018 · 0 comments

Comments

@sbusemann
Copy link

Added by Alex Kellner

from https://forge.typo3.org/issues/77146

Currently we're doing a large migration and within this project, we want to migrate from tt_adddress 2.3.5 to 3.0.3.
Because of some valid reasons we call your update script from a CommandController, what basicly works like a charm.

Nevertheless, there are 2 or 3 categories that are throwing an exception when trying to import.
This may happen because the customer has strange datamanagement and I'm not sure why this categories are failing with:

array(4 items)
  caller => "TYPO3\CMS\Core\Database\DatabaseConnection::exec_UPDATEquery" (60 chars)
  ERROR => "You have an error in your SQL syntax; check the manual that corresponds to y
     our MySQL server version for the right syntax to use near '' at line 1" (146 chars)
  lastBuiltQuery => "UPDATE sys_category SET parent='67' WHERE uid=" (46 chars)
  debug_backtrace => "call_user_func#27 // {closure}# // TYPO3\CMS\Backend\Console\Application->ru
     n#26 // TYPO3\CMS\Core\Core\Bootstrap->handleRequest#73 // TYPO3\CMS\Backend
     \Console\CliRequestHandler->handleRequest#302 // call_user_func#69 // TYPO3\
     CMS\Core\Cache\Backend\SimpleFileBackend->{closure}# // TYPO3\CMS\Extbase\Co
     re\Bootstrap->run#154 // TYPO3\CMS\Extbase\Core\Bootstrap->handleRequest#193
      // TYPO3\CMS\Extbase\Mvc\Cli\RequestHandler->handleRequest#206 // TYPO3\CMS
     \Extbase\Mvc\Dispatcher->dispatch#91 // TYPO3\CMS\Extbase\Mvc\Controller\Com
     mandController->processRequest#86 // TYPO3\CMS\Extbase\Mvc\Controller\Comman
     dController->callCommandMethod#139 // call_user_func_array#257 // In2code\In
     2template\Command\ImportCommandController->ttAddressGroupsImportCommand# //
     TYPO3\TtAddress\Updates\AddressGroupToSysCategory->performUpdate#91 // TYPO3
     \TtAddress\Updates\AddressGroupToSysCategory->updateParentFieldOfMigratedCat
     egories#103 // TYPO3\CMS\Core\Database\DatabaseConnection->exec_UPDATEquery#
     264 // TYPO3\CMS\Core\Database\DatabaseConnection->debug#268" (1048 chars)

A simple solution is to typecast two variables in \TYPO3\TtAddress\Updates\AddressGroupToSysCategory::updateParentFieldOfMigratedCategories():

$sysCategoryUid = (int)$oldNewCategoryUidMapping[$row['uid']];
$newParentUid = (int)$oldNewCategoryUidMapping[$row['parent_group']];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants