[TYPO3-mvc] Extbase 1.3.0: CLI Importer setPid() not working properly

Cornelius Illi cornelius.illi at hintertuer.net
Thu Mar 17 04:55:58 CET 2011


Hi,

Found it out myself!! The PID-Field needs to be set in the ColumnMap,
therefore needs an entry in the TCA-Konfiguration:

'pid' => Array (  
 'exclude' => 1,
 'label' => 'PID',
 'config' => Array (
  'type' => 'none',
 )
),




Am 3/16/11 11:02 PM schrieb "Cornelius Illi" unter
<cornelius.illi at hintertuer.net>:

>Hi guys,
>
>I am currently migrating an extension to Extbase/Fluid.
>In order to migrate the existing data to a new data-model I have written a
>CLI-Importer, that needs to set the existing PID.
>Within a CLI-Script the Persistance-Manager needs to be called manually:
>
>$person->setLastname('X');
>
>$person->setFirstname('Y');
>
>$this->person_repo->add($person);
>
>$this->persistanceManager->persistAll();
>
>    
>
>$person->setPid(499);
>
>$this->person_repo->update($person);
>
>var_dump($person->getPid());
>
>$this->persistanceManager->persistAll();
>
>var_dump($person->getPid());
>
>$test = $this->person_repo->findOneByLastname('Illi');
>
>var_dump($test->getPid());
>
>
>
>Output is:
>
>int(499)
>
>int(499)
>
>int(499)
>
>
>
>But Database says:
>
>+-----+-----+----------+-----------+
>
>| uid | pid | lastname | firstname |
>
>+-----+-----+----------+-----------+
>
>|   1 |   0 | X        | Y         |
>
>+-----+-----+----------+-----------+
>
>1 row in set (0.00 sec)
>
>
>
>Any ideas, what is going wrong there. I checked the Backend.php and
>actually
>it should set the PID within the update and the second persistAll()-call.
>
>Being able to set the PID is quite important, as new data is going to be
>imported by a scheduler-task and PID needs to be set dynamically,
>depending
>on the values set.
>
>
>
>Thanks for your help!
>
>Regards,
>
>
>
>Cornelius
>
>
>
>
>
>_______________________________________________
>TYPO3-project-typo3v4mvc mailing list
>TYPO3-project-typo3v4mvc at lists.typo3.org
>http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc




More information about the TYPO3-project-typo3v4mvc mailing list