Coder Social home page Coder Social logo

contao-community-alliance / dc-general Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 21.0 9.28 MB

Universal data container for Contao!

Home Page: https://dc-general.readthedocs.io/de/latest/

License: GNU Lesser General Public License v3.0

Ruby 0.02% JavaScript 1.12% PHP 98.67% SCSS 0.19%
contao dc-general dcg driver php

dc-general's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dc-general's Issues

Support "reference" field key.

Maybe we want to add an inline translator with custom prefix like dca-name.property.optionvalue or the like.
We need to discuss on this topic.

[WIP] Relation definition

Original: MetaModels-archive/DC_General#110

$GLOBALS['TL_DCA']['tl_table'] = array(
    'dca_config'      => array
    (
        'data_provider'  => array
        (
            'default' => array
            (
                'class'  => '...',
                'source' => 'tl_table'
            ),
            'parent'  => array
            (
                'class'  => '...',
                'source' => 'tl_ptable'
            ),
        ),
        'childCondition' => array(
            // parent condition
            array(
                'from'   => 'tl_ptable',
                'to'     => 'tl_table',
                'filter' => array
                (
                    array
                    (
                        'remote'    => 'id',
                        'local'     => 'pid',
                        'operation' => '=',
                    )
                )
            ),
            // childs condition
            array(
                'from'   => 'tl_table',
                'to'     => 'tl_ctable',
                'setOn'  => array
                (
                    array(
                        'from_field' => 'id',
                        'to_field'   => 'pid',
                    ),
                ),
                'filter' => array
                (
                    array
                    (
                        'local'     => 'id',
                        'remote'    => 'pid',
                        'operation' => '=',
                    )
                )
            ),
        )
    ),
);

The childCondition array does not only contain conditions to children, even the parent condition need to be defined here.

Now I will try to find a new syntax, that is simpler and more comprehensible.

$GLOBALS['TL_DCA']['tl_ptable'] = array(
    'dca_config'      => array
    (
        'data_provider'  => array
        (
            'default' => array
            (
                'class'  => '...',
                'source' => 'tl_ptable'
            ),
        ),
        // now we define only child conditions here from tl_ptable -> tl_table
        'childCondition' => array(
            'tl_table' => array(
                // the mapping is always parent table field -> child table field
                'mapping' => array(
                    'id' => 'ptable_id',
                ),
            ),
        ),
    ),
);

$GLOBALS['TL_DCA']['tl_table'] = array(
    'dca_config'      => array
    (
        'data_provider'  => array
        (
            'default' => array
            (
                'class'  => '...',
                'source' => 'tl_table'
            ),

            // the parent provider is required to tell DCG where the
            // parent->child condition can be found!
            'parent'  => array
            (
                'class'  => '...',
                'source' => 'tl_ptable'
            ),
        ),

        // we will not define the tl_ptable -> tl_table condition here,
        // DCG *must* read this from the parent data provider
        // we define only child conditions here from tl_table -> tl_ctable here
        'childCondition' => array(
            'tl_ctable' => array(
                'mapping' => array(
                    'id' => 'table_id',
                ),
            ),
        )
    ),
);

$GLOBALS['TL_DCA']['tl_ctable'] = array(
    'dca_config'      => array
    (
        'data_provider'  => array
        (
            'default' => array
            (
                'class'  => '...',
                'source' => 'tl_ctable'
            ),
            'parent'  => array
            (
                'class'  => '...',
                'source' => 'tl_table'
            ),
        ),
        // we need no child condition here anymore
    ),
);

Why I will not allow child conditions from/to other tables that not belong to the DCA table? Because the condition must be specified in the specific DCA. I don't like redundance!

Why I don't need setOn? The mapping is reflecting wich fields must be set, to fill the correct relation. There is no need for the even redundant definition in setOn.

How about special filters? If a filter does not belong the the mapping (I don't think this situation may exists here), we could add a field filter as sibling to mapping, that works the way we have now.

Contao FileTree-OrderField inkompatibel

Original: MetaModels-archive/DC_General#133

Ich hoffe das hier ist noch das richtige repository. Ich baue gerade eine Sortierbarkeit in das FileAttribut von MetaModels ein. Dabei ist mir aufgefallen, das das FileTree-Widget teilweise inkompatibel ist.
Im Widget wird auf $this->activeRecord->id verwiesen. Der activeRecord ist beim DC General jedoch nicht vorhanden, wodurch die ID in dieser Query: https://github.com/contao/core/blob/master/system/modules/core/widgets/FileTree.php#L101 nicht gesetzt wird.
Ich denke man bräuchte entweder ein eigenes Widget oder DC General müsste für diese Fälle einen activeRecord bereitstellen.

Sorting / Darstellung von Kind-Elementen

Original: MetaModels-archive/DC_General#142

Im Sortmode 3 (Sortieren von Kindelementen nach Elternelement) werden leider immer noch alle Items in einem MM angezeigt.
Sortiermodus 4 zeigt dagegen nur die passenden Kindelemente an, bietet dazu dann noch das Elternelement zum Bearbeiten, was dann den Namen 'tstamp.0 05.07.2014 13:57' bekommt, von daher auch etwas unbrauchbar ist an der Stelle ;-)

Viele Grüße

Per Hand Sortieren

Original: MetaModels-archive/DC_General#92

Wenn man nur per Hand sortiern möchte, dann muss man trotzdem angeben, das der Sortiermodus 2 ist, damit das überhaupt funktioniert.
Ich glaube das sollte irgendwo als Hinweis auftauchen oder so...

Messages will not displayed in list view

Original: MetaModels-archive/DC_General#98

In the regular list view, no messages ($_SESSION['TL_INFO'] and so on) will be shown.

tristanlins

It affect the contao3 branch, I do not tested the other branches ;-)

discordier

So we need to investigate. :)

We should add the "addError()" method to the interface IMO and refreign from using the Session directly.
What do you think?

cc @stefanheimes

Sortierung funktionert im Mode 4 teilweise nicht richtig

Im mode 4 gibt es anscheinend noch Probleme mit dem manuellen sortieren.

Ausgangslage:
bildschirmfoto 2014-05-13 um 15 08 21

Wenn ich dann den Eintrag "Titel" unter den Eintrag "Kategorie" schiebe, dann wird auf einmal Datum unterhalb von "Veröffentlichung" positioniert bzw. bei weiteren versuchen willkürlich wo anders hin geschoben.

bildschirmfoto 2014-05-13 um 15 08 39

New option to force edit mode

Original: MetaModels-archive/DC_General#88

We need a flag to force the edit mode. Same as when the drive has not the interface "listable" implements.

If the flag is true, the show_all and maybe some other functions call the edit function.

Source:
https://github.com/MetaModels/DC_General/blob/master/system/modules/generalDriver/DC_General.php#L2361

New:

        public function showAll()
    {
+              if($this->forceEdit)
+              {
+                      return $this->edit();
+              }

        $strReturn = $this->objController->showAll();
        if ($strReturn != null && $strReturn != "")
        {
            return $strReturn;
        }

        $strReturn = $GLOBALS['TL_CONFIG']['debugMode'] ? $this->setupTimer() : '';
        return $strReturn . $this->objViewHandler->showAll();
    }

So we need a new DCA option: 'forceEdit' => true

$GLOBALS['TL_DCA']['tl_aaaa'] = array(
    'config'   => array(
        'dataContainer'              => 'General',
        'closed'                         => true,
        'disableSubmit'              => false,
        'forceEdit'                      => true,
        'onload_callback'            => array(
            array('tl_language2file_export', 'onload_callback'),
        ),
        'onsubmit_callback'         => array(
            array('tl_language2file_export', 'onsubmit_callback'),
        ),        
    ),

Nach 'Dateibaum anpassung' Wurzelordner wählen (beim Klick auf Speichern)

Fatal error: Uncaught exception ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException with message Unparsable encoded id value: '' thrown in composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/IdSerializer.php on line 140

#0 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Controller/Ajax3X.php(162): ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\IdSerializer::fromSerialized('')
#1 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Controller/Ajax3X.php(220): ContaoCommunityAlliance\DcGeneral\Controller\Ajax3X->reloadTree('file', Object(ContaoCommunityAlliance\DcGeneral\Contao\Compatibility\DcCompat))
#2 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Controller/Ajax.php(246): ContaoCommunityAlliance\DcGeneral\Controller\Ajax3X->reloadFiletree(Object(ContaoCommunityAlliance\DcGeneral\Contao\Compatibility\DcCompat))
#3 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/BaseView.php(891): ContaoCommunityAlliance\DcGeneral\Controller\Ajax->executePostActions(Object(ContaoCommunityAlliance\DcGeneral\Contao\Compatibility\DcCompat))
#4 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/DC_General.php(94): ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\BaseView->handleAjaxCall()
#5 system/modules/core/classes/Backend.php(259): ContaoCommunityAlliance\DcGeneral\DC_General->__construct('tl_metamodel_at...', Array)
#6 contao/main.php(136): Contao\Backend->getBackendModule('metamodels')
#7 contao/main.php(287): Main->run()
#8 {main}

[TNG] Property sorting is not registered.

MM mit Standalone EingabeMaske im BackendMenu.
Beim Aufruf :

Fatal error: Uncaught exception ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException with message Property sorting is not registered. thrown in composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/DataDefinition/Definition/DefaultPropertiesDefinition.php on line 116

#0 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/BaseView.php(354): ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\DefaultPropertiesDefinition->getProperty('sorting')
#1 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/ListView.php(191): ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\BaseView->getGroupingMode()
#2 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/ListView.php(326): ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView->viewList(Object(ContaoCommunityAlliance\DcGeneral\Data\DefaultCollection))
#3 [internal function]: ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView->showAll()
#4 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/BaseView.php(155): call_user_func_array(Array, Array)
#5 [internal function]: ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\BaseView->handleAction(Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#6 composer/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#7 composer/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#8 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Event/EventPropagator.php(120): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#9 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Event/EventPropagator.php(72): ContaoCommunityAlliance\DcGeneral\Event\EventPropagator->dispatch('dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#10 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Controller/DefaultController.php(122): ContaoCommunityAlliance\DcGeneral\Event\EventPropagator->propagate('dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent), Array)
#11 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(210): ContaoCommunityAlliance\DcGeneral\Controller\DefaultController->handle(Object(ContaoCommunityAlliance\DcGeneral\Action))
#12 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(233): MetaModels\BackendIntegration\Module->runDC()
#13 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(251): MetaModels\BackendIntegration\Module->performNormal()
#14 system/modules/core/classes/Backend.php(410): MetaModels\BackendIntegration\Module->generate()
#15 contao/main.php(142): Contao\Backend->getBackendModule('metamodel_mm_pr...')
#16 contao/main.php(293): Main->run()
#17 {main}

Contao3 - deprecated Meldung in DefaultController.php

Original: MetaModels-archive/DC_General#115

Wenn man einen Datensatz duplizieren möchte, kommt folgende Fehlermeldung:

Deprecated notice: deprecated - use getEnvironment()->setCurrentModel() instead. in system/modules/generalDriver/DcGeneral/DC_General.php on line 1304 

Die Ursache liegt in der folgende Zeile:
https://github.com/MetaModels/DC_General/blob/contao3/system/modules/generalDriver/DcGeneral/Controller/DefaultController.php#L664

Wenn man die Zeile anpasst, ist die Meldung weg.

Contao 2.11 ClassLoader wird nicht geladen

Ich habe gerade einmal das nightly von der MetaModels Website für den TNG installiert. Dieses liefert ja auch den DCG 2.0 mit. Nach der Installation erhalte ich folgende Fehlermeldung:

[10-Jun-2014 15:28:45 Europe/Berlin] PHP Warning: require_once(/Applications/MAMP/htdocs/xxx/system/modules/dc-general/ContaoCommunityAlliance/DcGeneral/Contao/Compatibility/ClassLoader.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/xxx/system/modules/dc-general/config/config.php on line 37

Der Fehler entsteht dadurch das Pfad zum ClassLoader falsch zusammengesetzt wird. Aktuell sieht dies wie folgt aus:

$baseDir = dirname(__DIR__) .
    DIRECTORY_SEPARATOR . 'ContaoCommunityAlliance' .
    DIRECTORY_SEPARATOR . 'DcGeneral' .
    DIRECTORY_SEPARATOR . 'Contao' .
    DIRECTORY_SEPARATOR . 'Compatibility' .
    DIRECTORY_SEPARATOR;

richtig wäre aber:

$baseDir = dirname(__DIR__) .
    DIRECTORY_SEPARATOR . 'classes' .
    DIRECTORY_SEPARATOR . 'src' .
    DIRECTORY_SEPARATOR . 'ContaoCommunityAlliance' .
    DIRECTORY_SEPARATOR . 'DcGeneral' .
    DIRECTORY_SEPARATOR . 'Contao' .
    DIRECTORY_SEPARATOR . 'Compatibility' .
    DIRECTORY_SEPARATOR;

Zu finden ist das ganze hier:

$baseDir = dirname(__DIR__) .
DIRECTORY_SEPARATOR . 'ContaoCommunityAlliance' .
DIRECTORY_SEPARATOR . 'DcGeneral' .
DIRECTORY_SEPARATOR . 'Contao' .
DIRECTORY_SEPARATOR . 'Compatibility' .
DIRECTORY_SEPARATOR;

Sorting im Backend per Drag & Drop Item speichert das Ergebniss nicht

Original: MetaModels-archive/DC_General#141

Ausgabe ist:

Fatal error: Uncaught exception ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException with message Invalid parameters. thrown in composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/BaseView.php on line 1174

#0 [internal function]: ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\BaseView->paste()
#1 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/BaseView.php(160): call_user_func_array(Array, Array)
#2 [internal function]: ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\BaseView->handleAction(Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent), 'dc-general.acti...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#3 composer/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent), 'dc-general.acti...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#4 composer/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#5 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Event/EventPropagator.php(120): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#6 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Event/EventPropagator.php(72): ContaoCommunityAlliance\DcGeneral\Event\EventPropagator->dispatch('dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#7 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Controller/DefaultController.php(120): ContaoCommunityAlliance\DcGeneral\Event\EventPropagator->propagate('dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent), Array)
#8 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(233): ContaoCommunityAlliance\DcGeneral\Controller\DefaultController->handle(Object(ContaoCommunityAlliance\DcGeneral\Action))
#9 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(256): MetaModels\BackendIntegration\Module->runDC()
#10 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(274): MetaModels\BackendIntegration\Module->performNormal()
#11 system/modules/core/classes/Backend.php(272): MetaModels\BackendIntegration\Module->generate()
#12 contao/main.php(142): Contao\Backend->getBackendModule('metamodel_mm_th...')
#13 contao/main.php(293): Main->run()
#14 {main}

[WIP] Version Handling

Original: MetaModels-archive/DC_General#85

Das Version Handling funktioniert zwar, ist aber in der Umsetzung doch noch sehr DCT orientiert. Vor allem das Binding an GeneralModel's ist nicht so schön, ein spezielles Version Model würde hier die Implementierung sicherlich verbessern.

Hier nur kurz die Änderungen in Code, die ich zur Diskussion stellen würde:

interface InterfaceGeneralData
{
    /**
     * @return InterfaceRecordVersionModel
     */
    public function saveVersion(InterfaceGeneralModel $objModel, $strUsername);

    /**
     * @return InterfaceRecordVersionModel
     */
    public function getVersion($mixID, $mixVersion);

    /**
     * @return InterfaceGeneralCollection<InterfaceRecordVersionModel>
     */
    public function getVersions($mixID, $blnOnlyActive = false);

    public function setVersionActive(InterfaceRecordVersionModel $version);

    /**
     * @return InterfaceRecordVersionModel
     */
    public function getActiveVersion($mixID);
}
interface InterfaceRecordVersionModel
{
    /**
     * Return the ID of the version.
     *
     * @return mixed
     */
    public function getId();

    /**
     * Check if this version is active.
     *
     * @return bool
     */
    public function isActive();

    /**
     * Return the version number.
     *
     * @return mixed
     */
    public function getNumber();

    /**
     * Return the version timestamp.
     *
     * @return DateTime
     */
    public function getDateTime();

    /**
     * Return .a model reflecting this version.
     *
     * @return InterfaceGeneralModel
     */
    public function getRecord();
}

Ich möchte vor allem ID und Versionsnummer trennen, ich verwende in meiner ORM Integration UUID's. Die aktuelle Implementierung kann aber nicht zwischen ID und Versionsnummer unterscheiden.

andreasisaak

Eventuell ist es schon zu spät dafür aber ich muss zu bedenken geben das die volle UUID schrecklich zu lesen ist. Wenn die bereits in DCG 2.0 eingebaut wurde, kürzt diese bitte bei der Anzeige für den Redakteur ab. Wie Github es mit den Commit ID's auch tut.

Manuelle sortierung auch im standalone mode

Es wäre, abweichend von den Funktionen des DC_Table, super wenn man auch in einem DCA Mode ohne Parent- bzw. Child-Tabelle manuell sortieren könnte.
Wir haben einige Fälle wo wir nur eine Ebene haben, der Kunde dort aber gerne manuell sortieren würde.
Gibt es da schon Planungen in diese Richtung?

Support foreignKey.

The DCA property foreignKey is currently entirely unsupported.

We need some workaround.

Plötzlich fehlermeldung beim speichern von Childdatensätzen

Original: MetaModels-archive/DC_General#65

Ich habe zwei MetaModels in einer Parent-Child Beziehung angelegt, also ein MM als Subtabelle der anderen. Das hat bisher auch super funktioniert und ich habe auch schon diverse Datensätze angelegt, aber jetzt bekomme ich immer folgende Meldung:

Fatal error: Call to a member function getProperty() on a non-object in /Applications/MAMP/htdocs/xxx/system/modules/generalDriver/GeneralControllerDefault.php on line 1899

Catch exceptions in ContaoWidgetManager::[en/de]codeValue()

ContaoWidgetManager::[en/de]codeValue() is triggering the event for encoding values.

We need to put some safe constraints in there, as the old save_callbacks may throw exceptions.

I am unsure as of how to handle them, as the event propagation will stop after the first exception.
Maybe we need another property "errors" in the EncodePropertyValueFromWidgetEvent and DecodePropertyValueForWidgetEvent which will get filled by the PropertyOnLoadCallbackListener and PropertyOnSaveCallbackListener whenever an exception is raised.

Custom sorting and grouping

Currently it is impossible to define custom sorting, when grouping is enabled. For example SQL is prohibited, because the sorting fields are used for grouping and SQL is not a valid property name ...

Drop re-enforced loading of dca files.

I've recently struggled with the forced reloading of dca files by the dc-general.

I don't know why you've made the decision not checking if the dca already existing and using the loaded one. The downside of this practise are:

  1. I can not load the dca container using the API provided by dc-general for Contao core classes.
    I completely agree that using classes inside tl_foo.php files is a bad practise but it's unfortunately common in Contao. I'd like to access the container by:
$factory   = new DcGeneralFactory();
$container = $factory
    ->setContainerName('tl_article')
    ->setEventPropagator($propagator)
    ->setTranslator($translator)
    ->createContainer();
  1. If I want to load another dca during the loading of the dca it should not be available later on. You can arguing why not using the dc-general to create the container. It does not work for core dca as explaining in 1.
    Following example should not work:
// inside the onload callback or the corresponding event
$this->loadDataContainer('tl_article');

// inside the onsubmit callback or the corresponding event
// is not loaded because it was thrown away by the DcaReadingDateDefinitionBuilder
if($GLOBALS['TL_DCA']['tl_article']['fields']['relatedField']['eval']['rgxp'] == 'foo') {
    // ...
}

I guess there's a reason for force reloading the DCA. I don't see it yet, but hope we could find a way to solve the drawbacks mentioned above.

Filetree für Contao 2.x.x

Orgininal: MetaModels-archive/DC_General#105

Die Funktion im FilTree, generateAjax, verursacht im Force Edit Mode Probleme. Da diese Funktion prüft ob die Tabelle oder das Feld besteht. Die muss aber nicht immer der Fall sein.

Daher sollten ein GeneralFileTree erstellt werden, welcher diese Funktion überschreibt und die DB Abfrage optional macht.

Buttons save and save+close does not follow the same flow

Original: MetaModels-archive/DC_General#93

I find out, that the save and save+close buttons does not follow the same flow in code. If I press save+close the onsubmit_callback will not be triggered, for example. I need to investigate more time in this, currently I only tried a bit in the backend.

This may be the reason why the problem between MM and Avisota only occurs when pressing save+close.

Javascript für Toggle ist zu unflexibel

Ich arbeite gerade an folgendem Feature MetaModels/attribute_checkbox#3. Dabei ist mir aufgefallen, dass das Javascript für den Toggler zu unflexibel ist. Dieses ist so geschrieben das es nur mit Grafiken funktioniert, die visible und invisible heißen. Dies ist aber Problematisch, wenn man dem User die Auswahl der grafiken überlassen will.

Aktuell sieht der Link der für das Togglen erzeugt wird, wie folgt aus:

<a onclick="Backend.getScrollOffset(); return BackendGeneral.toggleVisibility(this);" title="" href="contao/main.php?do=metamodel_mm_press_message&act=listviewtoggle_testtoggle&id=mm_press_message::9&rt=123eab8a70643e039703cd82a7cb0027&ref=b599c963">
<img width="16" height="16" alt="listviewtoggle_testtoggle" src="files/visible.gif">
</a>

Mein Vorschlag wäre, das man bei der Erzeugung des Links die Grafiken mit übergibt, also wie folgt:

<a onclick="Backend.getScrollOffset(); return BackendGeneral.toggleVisibility(this, 'files/enabled.gif', 'files/disabled.gif');" title="" href="contao/main.php?do=metamodel_mm_press_message&act=listviewtoggle_testtoggle&id=mm_press_message::9&rt=123eab8a70643e039703cd82a7cb0027&ref=b599c963">
<img width="16" height="16" alt="listviewtoggle_testtoggle" src="files/visible.gif">
</a>

Nach einer entsprechenden Anpassung des DcGeneral-Javascript, sollte es dann möglich sein jede Grafik zu nutzen.

Ist der Weg für euch in Ordnung? Wenn ja mache ich einen entsprechenden PR.

Pflichtfeld beim TreePicker -> Error beim neu Anlegen von einem Item

Contao 3.3.3
DCG ist TNG

Fehlermeldung:

Pflichtfeld Namedesfeldes*

Fatal error: Call to a member function getEnvironment() on a non-object in /www/htdocs/v160803/contao3/system/modules/dc-general/classes/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/TreePicker.php on line 250

Filtern im BE auf Attribut vom typ translatedtags

Original: MetaModels-archive/DC_General#121

Deprecated notice: Filter array uses deprecated entry "childs", please use "children" instead. in composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/DcGeneral/Data/Driver.php on line 297

#0 [internal function]: __error(16384, 'Filter array us...', '/var/www/virtua...', 297, Array)
#1 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/DcGeneral/Data/Driver.php(297): trigger_error('Filter array us...', 16384)
#2 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/DcGeneral/Data/Driver.php(444): MetaModels\DcGeneral\Data\Driver->calculateSubfilter(Array, Object(MetaModels\Filter\Filter))
#3 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/DcGeneral/Data/Driver.php(527): MetaModels\DcGeneral\Data\Driver->prepareFilter(Array)
#4 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/Panel/DefaultFilterElement.php(144): MetaModels\DcGeneral\Data\Driver->getFilterOptions(Object(DcGeneral\Data\DefaultConfig))
#5 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/Panel/DefaultPanel.php(71): DcGeneral\Panel\DefaultFilterElement->initialize(Object(DcGeneral\Data\DefaultConfig), NULL)
#6 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/Panel/DefaultPanelContainer.php(70): DcGeneral\Panel\DefaultPanel->initialize(Object(DcGeneral\Data\DefaultConfig), NULL)
#7 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/Controller/DefaultController.php(1248): DcGeneral\Panel\DefaultPanelContainer->initialize(Object(DcGeneral\Data\DefaultConfig))
#8 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/Controller/DefaultController.php(1263): DcGeneral\Controller\DefaultController->buildPanel()
#9 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/DC_General.php(2382): DcGeneral\Controller\DefaultController->showAll()
#10 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(176): DcGeneral\DC_General->showAll()
#11 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(196): MetaModels\BackendIntegration\Module->runDC()
#12 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(210): MetaModels\BackendIntegration\Module->performNormal()
#13 system/modules/core/classes/Backend.php(266): MetaModels\BackendIntegration\Module->generate()
#14 contao/main.php(136): Contao\Backend->getBackendModule('metamodel_mm_it...')
#15 contao/main.php(287): Main->run()
#16 {main}

Warning: array_key_exists() expects parameter 2 to be array

I get the following warning when the MetaModels back end module is opened:

Warning: array_key_exists() expects parameter 2 to be array, string given in composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Contao/Dca/Builder/Legacy/DcaReadingDataDefinitionBuilder.php on line 75

#0 [internal function]: __error(2, 'array_key_exist...', '/var/www/virtua...', 75, Array)
#1 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Contao/Dca/Builder/Legacy/DcaReadingDataDefinitionBuilder.php(75): array_key_exists('__selector__', '')
#2 composer/vendor/bit3/contao-meta-palettes/src/MetaPalettesBuilder.php(66): ContaoCommunityAlliance\DcGeneral\Contao\Dca\Builder\Legacy\DcaReadingDataDefinitionBuilder->getFromDca('palettes/__sele...')
#3 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/DataDefinition/Builder/AbstractEventDrivenDataDefinitionBuilder.php(50): MetaPalettesBuilder->build(Object(ContaoCommunityAlliance\DcGeneral\DataDefinition\DefaultContainer), Object(ContaoCommunityAlliance\DcGeneral\Factory\Event\BuildDataDefinitionEvent))
#4 [internal function]: ContaoCommunityAlliance\DcGeneral\DataDefinition\Builder\AbstractEventDrivenDataDefinitionBuilder::process(Object(ContaoCommunityAlliance\DcGeneral\Factory\Event\BuildDataDefinitionEvent))
#5 composer/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func('MetaPalettesBui...', Object(ContaoCommunityAlliance\DcGeneral\Factory\Event\BuildDataDefinitionEvent))
#6 composer/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'dc-general.fact...', Object(ContaoCommunityAlliance\DcGeneral\Factory\Event\BuildDataDefinitionEvent))
#7 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Event/EventPropagator.php(120): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('dc-general.fact...', Object(ContaoCommunityAlliance\DcGeneral\Factory\Event\BuildDataDefinitionEvent))
#8 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Event/EventPropagator.php(72): ContaoCommunityAlliance\DcGeneral\Event\EventPropagator->dispatch('dc-general.fact...', Object(ContaoCommunityAlliance\DcGeneral\Factory\Event\BuildDataDefinitionEvent))
#9 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Factory/DcGeneralFactory.php(406): ContaoCommunityAlliance\DcGeneral\Event\EventPropagator->propagate('dc-general.fact...', Object(ContaoCommunityAlliance\DcGeneral\Factory\Event\BuildDataDefinitionEvent), Array)
#10 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Factory/DcGeneralFactory.php(348): ContaoCommunityAlliance\DcGeneral\Factory\DcGeneralFactory->createContainer()
#11 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/Factory/DcGeneralFactory.php(300): ContaoCommunityAlliance\DcGeneral\Factory\DcGeneralFactory->createEnvironment()
#12 composer/vendor/contao-community-alliance/dc-general/src/ContaoCommunityAlliance/DcGeneral/DC_General.php(67): ContaoCommunityAlliance\DcGeneral\Factory\DcGeneralFactory->createDcGeneral()
#13 system/modules/core/classes/Backend.php(397): ContaoCommunityAlliance\DcGeneral\DC_General->__construct('tl_metamodel', Array)
#14 contao/main.php(142): Contao\Backend->getBackendModule('metamodels')
#15 contao/main.php(293): Main->run()
#16 {main}

How to reproduce:

  • Set up a new Contao 3.3.3 installation
  • Install the Composer back end client
  • Install the MetaModels core and bundle_all packages as shown in the screenshot:
    composer
  • Open the MetaModels back end module

BE, Suche aktiviert, mit FeldTyp "Text" und "tags"

Original: MetaModels-archive/DC_General#132

Warning: Illegal offset type in composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/Panel/DefaultFilterElement.php on line 159

#0 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/Panel/DefaultFilterElement.php(159): __error(2, 'Illegal offset ...', '/var/www/client...', 159, Array)
#1 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/Panel/DefaultPanel.php(71): DcGeneral\Panel\DefaultFilterElement->initialize(Object(DcGeneral\Data\DefaultConfig), NULL)
#2 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/Panel/DefaultPanelContainer.php(70): DcGeneral\Panel\DefaultPanel->initialize(Object(DcGeneral\Data\DefaultConfig), NULL)
#3 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/Controller/DefaultController.php(1279): DcGeneral\Panel\DefaultPanelContainer->initialize(Object(DcGeneral\Data\DefaultConfig))
#4 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/Controller/DefaultController.php(1294): DcGeneral\Controller\DefaultController->buildPanel()
#5 composer/vendor/metamodels/dc_general/system/modules/generalDriver/DcGeneral/DC_General.php(2382): DcGeneral\Controller\DefaultController->showAll()
#6 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(176): DcGeneral\DC_General->showAll()
#7 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(196): MetaModels\BackendIntegration\Module->runDC()
#8 composer/vendor/metamodels/core/src/system/modules/metamodels/MetaModels/BackendIntegration/Module.php(210): MetaModels\BackendIntegration\Module->performNormal()
#9 system/modules/core/classes/Backend.php(271): MetaModels\BackendIntegration\Module->generate()
#10 contao/main.php(136): Contao\Backend->getBackendModule('metamodel_mm_bu...')
#11 contao/main.php(287): Main->run()
#12 {main}

blackbee

Ich kann ebenfalls das Problem bestätigen.

Bei mir tritt das Problem in folgender Konstellation auf, wenn ich die Filterung für "Translated Tags" aktiviere.

Ich habe mir mal in Zeile 159 in der Datei DefaultFilterElement.php aus der foreach-Schleife das $objOption mittels print_r ausgeben lassen.

Dort ist zu sehen, dass das Element überhaupt keine Einträge aus den Tags anzeigt.

Wahrscheinlich liegt ein Defekt in der Übergabe aus dem MetaModels vor.

Kann das jemand von Euch überprüfen?

pandroid

Ich kann das auch bestätigen.
So bald ich das Attribut mit dem Feldtyp "tags" mit "Filterbar" markiere, erhalte ich beim Aufruf der Backend-Liste den Fehler

Warning: Illegal offset type in system/modules/generalDriver/DcGeneral/Panel/DefaultFilterElement.php on line 159
#0 system/modules/generalDriver/DcGeneral/Panel/DefaultFilterElement.php(159): __error(2, 'Illegal offset ...', '/www/htdocs/w00...', 159, Array)
#1 system/modules/generalDriver/DcGeneral/Panel/DefaultPanel.php(71): DcGeneral\Panel\DefaultFilterElement->initialize(Object(DcGeneral\Data\DefaultConfig), NULL)
#2 system/modules/generalDriver/DcGeneral/Panel/DefaultPanelContainer.php(70): DcGeneral\Panel\DefaultPanel->initialize(Object(DcGeneral\Data\DefaultConfig), NULL)
#3 system/modules/generalDriver/DcGeneral/Controller/DefaultController.php(1279): DcGeneral\Panel\DefaultPanelContainer->initialize(Object(DcGeneral\Data\DefaultConfig))
#4 system/modules/generalDriver/DcGeneral/Controller/DefaultController.php(1294): DcGeneral\Controller\DefaultController->buildPanel()
#5 system/modules/generalDriver/DcGeneral/DC_General.php(2382): DcGeneral\Controller\DefaultController->showAll()
#6 system/modules/metamodels/MetaModels/BackendIntegration/Module.php(176): DcGeneral\DC_General->showAll()
#7 system/modules/metamodels/MetaModels/BackendIntegration/Module.php(196): MetaModels\BackendIntegration\Module->runDC()
#8 system/modules/metamodels/MetaModels/BackendIntegration/Module.php(210): MetaModels\BackendIntegration\Module->performNormal()
#9 system/modules/core/classes/Backend.php(272): MetaModels\BackendIntegration\Module->generate()
#10 contao/main.php(142): Contao\Backend->getBackendModule('metamodel_mm_sh...')
#11 contao/main.php(293): Main->run()
#12 {main}

Manuelles Sorting (blauer Pfeil)

Original: MetaModels-archive/DC_General#69

Wenn man den blauen Pfeil benutzt, muss man ja dann das braune Symbol mit Pfeil nach unten benutzten um das Item an der passenden Stelle einzufügen.
Normalerweise ist das in Contao dann 'unter' dem Element wo man das klickt. Hier ist das dann die selbe Stelle...
Müsste geändert werden um dem Contao Standard zu entsprechen. Dazu bräuchte man dann so ein Einfügen dann noch an Oberster Stelle, damit man auch das Item an erster Stelle einfügen kann.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.