[TYPO3-core] RFC #16177: Add DB structure update pre-processing hook in EM

Franz Holzinger franz at ttproducts.de
Tue Nov 2 18:07:27 CET 2010


Hello Xavier,
>>>> Could this patch be modified that the hook can be reached even
>>>> without a
>>>> file ext_tables.sql?
>>>> AFAIK only the file ext_tables_static+adt.sql is allowed to contain
>>>> INSERT commands.

>>> But if you provide a ext_tables_static+adt.sql, you should still have a
>>> corresponding ext_tables.sql file.

>> No, I do not have any ext_tables.sql file, because this is in the
>> extension statictemplates. And the extension mastertemplates only wants
>> to insert records there.
>
> Quoting the Core documentation:
> http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.2.0/view/2/1/

Thank you for this information.

> ext_tables_static+adt.sql
>
> Static SQL tables and their data.
>

> Notice: The table structure of static tables needs to be in the
> ext_tables.sql file as well - otherwise an installed static table will
> be reported as being in excess in the EM!
>
> ^^^^^^
>
> Thus you need a file ext_tables.sql even if it comes from "another
> extension". I did that in some of my extensions where I have a "master"
> extension that provides the database structure and others that have
> country-wide static data. Each and every of these children extensions
> have a copy of the database definition.

When I copy the file ext_tables.sql from statictemplates into 
mastertemplate, then I can reach the new hook function.
But I cannot live with the situation to insert a "DROP table 
static_templates", because then the static contents from statictemplates 
would be removed. And maybe even other extensions want to execute their 
own INSERTs.

So I must find a solution to use the new hook. 
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/mod/tools/em/index.php']['checkDBupdates'] 
to solve this problem.

When mastertemplate is installed, then the static data should be offered 
for an update on the screen (update button). At the moment nothing is 
shown and nothing is inserted.

- Franz



More information about the TYPO3-team-core mailing list