IchHabRecht / mask_export

Export your mask elements as extension
GNU General Public License v2.0
45 stars 27 forks source link

Can't overwrite Backend Preview #195

Closed artur-grigoryan-cgn closed 2 years ago

artur-grigoryan-cgn commented 2 years ago

Hello, i try to overwrite the Backend Preview of my export in the sitepackage but it doesn't work.

My files:

Configuration/TCA/Overrides/pages.php:

<?php
defined('TYPO3') or die('Access denied.');
call_user_func(function()
{
    /**
     * Temporary variables
     */
    $extensionKey = 'ivs_standard_elements_sitepackage';

    /**
     * Default PageTS for IvsStandardElementsSitepackage
     */
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
        $extensionKey,
        'Configuration/TsConfig/Page/All.tsconfig',
        'Ivs Standard Elements Sitepackage'
    );
});

Configuration/TsConfig/Page/All.tsconfig:

<INCLUDE_TYPOSCRIPT: source="FILE:EXT:imagine_vs_elements/Configuration/TsConfig/Page/BWICONS.tsconfig">
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:imagine_vs_elements/Configuration/TsConfig/Page/REMOVEELEMENTS.tsconfig">
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:ivs_standard_elements_sitepackage/Configuration/TsConfig/Page/BackendPreview.tsconfig">
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:ivs_standard_elements_sitepackage/Configuration/TsConfig/Page/NewContentElementWizard.tsconfig">

Configuration/TsConfig/Page/BackendPreview.tsconfig:

mod.web_layout.tt_content.preview.ivsstandardelements.templateRootPath = EXT:ivs_standard_elements_sitepackage/Resources/Private/Mask/Backend/Templates/
mod.web_layout.tt_content.preview.ivsstandardelements.layoutRootPath = EXT:ivs_standard_elements_sitepackage/Resources/Private/Layout/
mod.web_layout.tt_content.preview.ivsstandardelements.partialRootPath = EXT:ivs_standard_elements_sitepackage/Resources/Private/Partials/

I think it's an problem in the order because it works wenn i remove the following codine in the export (FILE:EXT:ivs_standard_elements):

mod.web_layout.tt_content.preview.ivsstandardelements.templateRootPath = EXT:ivs_standard_elements/Resources/Private/Backend/Templates/Content/
mod.web_layout.tt_content.preview.ivsstandardelements.layoutRootPath = EXT:ivs_standard_elements/Resources/Private/Backend/Layout/
mod.web_layout.tt_content.preview.ivsstandardelements.partialRootPath = EXT:ivs_standard_elements/Resources/Private/Backend/Partials/

First the export gets loaded in the template and then the sitepackage: ksnip_20220829-132408

Everything in the frontend gets overwritten perfectly.

peter-neumann-dev commented 2 years ago

Had this issue in the past. If you use composer mode, you have to add the export extension as a dependency of your sitepackage. If you still use ext_emconf you would add this to depends too. This should solve it, probably. If not, you can also refresh the setup and loading order of your extensions with: ./vendor/bin/typo3 extension:setup

artur-grigoryan-cgn commented 2 years ago

Thank you for your answer but it didn't work. :/

composer.json (sitepackage):

{
    "name": "xxx/ivs-standard-elements-sitepackage",
    "type": "typo3-cms-extension",
    "description": "",
    "homepage": "xxx/",
    "license": ["GPL-2.0-or-later"],
    "keywords": ["TYPO3 CMS"],
    "require": {
        "typo3/cms-core": "^11.5",
        "typo3/cms-rte-ckeditor": "^11.5",
        "typo3/cms-fluid-styled-content": "^11.5",
        "donatj/phpuseragentparser": "^1.5",
        "friendsofphp/php-cs-fixer": "^3.8",
        "fluidtypo3/flux": "^9.6",
        "fluidtypo3/vhs": "^6.1",
        "blueways/bw-icons": "^1.3",
        "mask/mask": "^7.2",
        "xxx/ivs-standard-elements": "dev-main"
    },
    "autoload": {
        "psr-4": {
            "x\\IvsStandardElementsSitepackage\\": "Classes/"
        }
    },
    "extra": {
        "typo3/cms": {
            "extension-key": "ivs_standard_elements_sitepackage"
        }
    },
    "config": {
        "allow-plugins": {
            "typo3/class-alias-loader": true,
            "typo3/cms-composer-installers": true
        }
    },
    "scripts":{
        "post-install-cmd": [
            "sudo chown www-data:www-data . -R",
            "sudo chmod -R 2775 ."
        ]
    },
    "require-dev": {
        "brainmaestro/composer-git-hooks": "^2.8"
    },
    "repositories": {
        "x/ivs_standard_elements":
        {
            "type": "vcs",
            "url": "git@gitlab.xxx.de:xxx/p0004-ivs-typo3-standard-elements.git"
        }
    }

}

ext_emconf (sitepackage):

<?php

/**
 * Extension Manager/Repository config file for ext "ivs_standard_elements_sitepackage".
 */
$EM_CONF[$_EXTKEY] = [
    'title' => 'Ivs Standard Elements Sitepackage',
    'description' => '',
    'category' => 'templates',
    'constraints' => [
        'depends' => [
            'typo3' => '11.5.0-11.5.99',
            'fluid_styled_content' => '11.5.0-11.5.99',
            'rte_ckeditor' => '11.5.0-11.5.99',
            'ivs_standard_elements' => 'dev-main',
        ],
        'conflicts' => [
        ],
    ],
    'autoload' => [
        'psr-4' => [
            'xxx\\IvsStandardElementsSitepackage\\' => 'Classes',
        ],
    ],
    'state' => 'stable',
    'uploadfolder' => 0,
    'createDirs' => '',
    'clearCacheOnLoad' => 1,
    'author' => 'xxx',
    'author_email' => 'xxx@xxx.de',
    'author_company' => 'xxx',
    'version' => '1.0.0',
];

Did "composer update" and "composer install" in the sitepackage and "./vendor/bin/typo3 extension:setup" in the TYPO3 root-dir.

peter-neumann-dev commented 2 years ago

Could you provide the output of ./vendor/bin/typo3 extension:setup please? Your sitepackage should get loaded after the export extension there.

artur-grigoryan-cgn commented 2 years ago

[OK] Extension(s) "core, extbase, fluid, install, recordlist, backend, frontend, dashboard, fluid_styled_content,
filelist, impexp, form, seo, setup, rte_ckeditor, belog, beuser, extensionmanager, felogin, info, lowlevel,
sys_note, t3editor, tstemplate, viewpage, vhs, flux, bw_icons, mask, ivs_standard_elements_sitepackage,
imagine_vs_template, mask_export, helhum/typo3-console, ivs_standard_elements, translate_locallang, typo3_encore" successfully set up.

peter-neumann-dev commented 2 years ago

Yes, here is the problem because ivs_standard_elements_sitepackage is loaded before ivs_standard_elements

I don't know if it will fix that, only difference in my package is that in composere.json we use @dev as version instead of dev-main and in ext_emconf (in older TYPO3 v10 installations, now since v11 we dropped ext_emconf completely) we had * instead of dev-main

artur-grigoryan-cgn commented 2 years ago

It's fixed. Thank you :)