[TYPO3-dev] FAL migration for custom tables

François Suter fsu-lists at cobweb.ch
Tue Jun 25 14:40:09 CEST 2013


Hi all,

The TYPO3 CMS Core comes with wizard to migrate file references to FAL 
for tables like pages and tt_content, including RTE-enabled fields, but 
has anything been planned for custom tables (of which there are 
certainly quite a few out there)?

I have started digging into this for one of my projects and am so far 
failing.

What I am missing in particular is when are sys_file entries created?

For example I have copied the code from the RTE magic images wizard 
(typo3/sysext/install/Classes/Updates/RteMagicImagesUpdateWizard.php) 
and I don't understand how it can work. It reads the sys_refindex to 
find related images (for example), it moves the file and then tries to 
fetch the related file object, using:

rename($fullSourceFileName, $fullTargetFileName);
$file = $this->storage->getFile($targetFileName);

This obviously fails since the file is just moved and no entry can exist 
for it in sys_file yet. How does the RTE magic images migration tool do it?

I have tried further things like, first creating my new folder with:

$fullTargetDirectory = PATH_site . $fileadminDirectory . $targetDirectory;
$targetFolder = $this->storage->createFolder($fullTargetDirectory);

and then moving the files with:

$file = $this->storage->addFile($fullSourceFileName, $targetFolder);

but nothing happens, no files moved, no entries in sys_file, nothing.

For reference, the full update class is there:

https://gist.github.com/fsuter/5858132

Any help would be very welcome, especially as I think this will be a 
very common need when people try to transition their site from 4.5 to 6.2.

Cheers

-- 

Francois Suter

Work: Cobweb Development Sarl - http://www.cobweb.ch

TYPO3: Help the project! - http://typo3.org/contribute/

Appreciate my work? Support me -
http://www.monpetitcoin.com/en/francois/support-me/




More information about the TYPO3-dev mailing list