logo
down
shadow

Extension installation prefill table


Extension installation prefill table

By : user2952889
Date : November 19 2020, 03:59 PM
Any of those help For me the ext_tables_static+adt.sql dosn't work ... I've done a workarround with prefilling the table if the table is empty!
code :


Share : facebook icon twitter icon
Typo3: Inserting data during extension installation (after table creation)

Typo3: Inserting data during extension installation (after table creation)


By : Adrian Varysoo
Date : March 29 2020, 07:55 AM
wish helps you Of course you can (with a litte trick):
Add an ext_conf_template.txt to your extension
code :
# cat=basic; type=user[EXT:<EXTNAME>/Path/To/Class.php:Tx_Path_To_Class->postInstall]; label=
postInstallAction=0
class Tx_Path_To_Class {
    /**
     * Generates and returns an message.
     *
     * @param array               $params      Name and value from ext_conf_template.txt
     * @param t3lib_tsStyleConfig $styleConfig Instance of config style editor
     *
     * @return string HTML code
     */
    public function postInstall(array $params, t3lib_tsStyleConfig $styleConfig) {
        // Do your stuff
        return '';
    }
Is there a way to create objects/ table entries during the extension installation in TYPO3?

Is there a way to create objects/ table entries during the extension installation in TYPO3?


By : P. Mercer
Date : March 29 2020, 07:55 AM
To fix this issue You can store your static data in the file ext_tables_static+adt.sql which must be located in the root folder of your extension.
According to the TYPO3 API, you must should use the following command to export your static data
code :
mysqldump --password=[password] [database name] [tablename] --add-drop-table > ./ext_tables_static.sql
Adding rows to table during extension installation TYPO3

Adding rows to table during extension installation TYPO3


By : Márcio Winter
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further So the soultion is to an Signal Extension Manager is emitting after installation. For that in my ext_localconf.php I added:
code :
if (TYPO3_MODE === 'BE') {
    $class = 'TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher';
    $dispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($class);
    $dispatcher->connect(
    'TYPO3\\CMS\\Extensionmanager\\Service\\ExtensionManagementService',
        'hasInstalledExtensions',
        'FalkRoeder\\GridelementsFlex\\Setup\\Setup',
        'addBackendLayouts'
    );
}
class Setup
{

    protected $layouts = [
       1 => [
           'title'  => 'Flexbox 50 50',
           'config'  => 'backend_layout {\r\n    colCount = 4\r\n    rowCount = 1\r\n    rows {\r\n        1 {\r\n            columns {\r\n                1 {\r\n                    name = links außen\r\n                    colPos = 1\r\n                }\r\n                2 {\r\n                    name = links innen\r\n                    colPos = 2\r\n                }\r\n                3 {\r\n                    name = rechts innen\r\n                    colPos = 3\r\n                }\r\n                4 {\r\n                    name = rechts außen\r\n                    colPos = 4\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n',
           'pi_flexform_ds_file'  => 'typo3conf/ext/gridelements_flex/Configuration/Flexforms/two_column_flex.xml'
       ]
    ];

    public function addBackendLayouts( $extname = null )
    {
        if( $extname !== 'gridelements_flex' ) {
           return;
        }

        foreach ($this->layouts as $layout) {

            list($row) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('COUNT(*) AS t', 'tx_gridelements_backend_layout', "title = '" . $layout['title'] . "'");
            $count = (int)$row['t'];

            if($count == 0) {
                $GLOBALS['TYPO3_DB']->exec_INSERTquery(
                    'tx_gridelements_backend_layout',
                    $layout
                );
            }
        }

    }
}
How to prefill a table in the db and optimize the DAO interface?

How to prefill a table in the db and optimize the DAO interface?


By : raufguliev
Date : March 29 2020, 07:55 AM
it fixes the issue Answer for 1st question: you can prepopulate the data using this post which explains how to do it clearly.
Answer for 2nd question : well it depends upon how neat you want to get with you code. By neat I meant applylying you object oriented principles, which will help to segregate the logic into generic DAO(if possible) and easy to maintain. This practice will help you in future when you develop big projects (believe me It's very helpful) which have hundred's of classes all doing the similar thing.
Wordpress localhost installation error - Your PHP installation appears to be missing the MySQL extension which is requir

Wordpress localhost installation error - Your PHP installation appears to be missing the MySQL extension which is requir


By : Rishabh
Date : March 29 2020, 07:55 AM
I wish did fix the issue. I know this question has been asked N number of times but I can't seem to get it worked. I am trying to install wordpress on my local VM machine. I have mysql running fine as shown below. , Install your mysql library for php, run:
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org