Skip to content

Commit

Permalink
Merge tag '2.1.2'
Browse files Browse the repository at this point in the history
Hotfix version

- Support for translated version
- Correct travis
- Correct Event Callbacke
  • Loading branch information
stefanheimes committed Mar 7, 2021
2 parents 68d547f + 1a6541e commit 27cfbe7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 21 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ php:
- "7.1"

env:
- CONTAO_VERSION=~4.8.0
- CONTAO_VERSION=~4.10.0
- CONTAO_VERSION=~4.9.0
- CONTAO_VERSION=~4.4.0

# Exclude impossible Contao Version combinations.
matrix:
exclude:
- php: "7.1"
env: CONTAO_VERSION=~4.10.0
fast_finish: true
allow_failures:
- env: CONTAO_VERSION=~4.8.0
- env: CONTAO_VERSION=~4.10.0

before_script:
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
Expand Down
Empty file modified README.md
100755 → 100644
Empty file.
11 changes: 8 additions & 3 deletions src/EventListener/InitializeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,15 @@ public function onKernelRequest(GetResponseEvent $event)
*/
public function addBackendModules(&$localMenu)
{
$strModule = Input::get('do');
$strTable = Input::get('table');
$strModule = Input::get('do');
$strTable = Input::get('table');
$blnLangSupport = Input::get('langSupport');

if (substr($strModule, 0, 10) == 'metamodel_' && $strTable == 'tl_content') {
if (
substr($strModule, 0, 10) == 'metamodel_'
&& $strTable == 'tl_content'
&& $blnLangSupport === null
) {
$needsToBeAdded = true;
foreach ($GLOBALS['BE_MOD'] as $key => $mod) {
if (isset($mod[$strModule])) {
Expand Down
14 changes: 5 additions & 9 deletions src/Resources/config/listeners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@ services:
MetaModels\AttributeContentArticleBundle\EventListener\BackendEventListener:
public: false
tags:
-
name: kernel.event_listener
- name: kernel.event_listener
event: 'dc-general.model.post-duplicate'
method: 'handlePostDuplicationModel'
-
name: kernel.event_listener
- name: kernel.event_listener
event: 'dc-general.model.post-paste'
method: 'handlePostPasteModel'
MetaModels\AttributeContentArticleBundle\EventListener\GetOptionsListener:
public: false
arguments:
- '@metamodels.factory'
tags:
-
name: kernel.event_listener
- name: kernel.event_listener
event: 'men-at-work.multi-column-wizard.get-options'
method: getOptions
MetaModels\AttributeContentArticleBundle\EventListener\InitializeListener:
Expand All @@ -27,7 +24,6 @@ services:
- "@contao.routing.scope_matcher"
- "@metamodels.view_combination"
tags:
-
name: kernel.event_listener
- name: kernel.event_listener
event: kernel.request
priority: -6000
priority: -600
16 changes: 11 additions & 5 deletions src/Resources/contao/dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,27 @@
* @filesource
*/

use Contao\Input;
use MetaModels\AttributeContentArticleBundle\Table\ArticleContent;

$GLOBALS['TL_DCA']['tl_content']['fields']['mm_slot'] = [
'sql' => "varchar(255) NOT NULL default ''",
];

$strModule = \Input::get('do');
$strTable = \Input::get('table');
$strModule = Input::get('do');
$strTable = Input::get('table');
$strLangSupport = Input::get('langSupport');

// Change TL_Content for the article popup
if (substr($strModule, 0, 10) == 'metamodel_' && $strTable == 'tl_content') {
if (
\substr($strModule, 0, 10) == 'metamodel_'
&& $strTable == 'tl_content'
&& $strLangSupport === null
) {
$GLOBALS['TL_DCA']['tl_content']['config']['dataContainer'] =
'TableMetaModelsContentArticle';
$GLOBALS['TL_DCA']['tl_content']['config']['ptable'] =
\Input::get('ptable');
Input::get('ptable');
$GLOBALS['TL_DCA']['tl_content']['config']['onsubmit_callback'][] =
[
ArticleContent::class,
Expand All @@ -52,6 +58,6 @@
$GLOBALS['TL_DCA']['tl_content']['list']['sorting']['filter'][] =
[
'mm_slot=?',
\Input::get('slot')
Input::get('slot')
];
}
1 change: 0 additions & 1 deletion src/Widgets/ContentArticleWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use Contao\Widget;
use ContaoCommunityAlliance\DcGeneral\Contao\Compatibility\DcCompat;
use Doctrine\DBAL\Connection;
use Twig\Environment;

/**
* Class ContentArticleWidget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ public function testLoad(): void
{
self::assertTrue($container->hasDefinition($expectedDefinition));
}

}
}

0 comments on commit 27cfbe7

Please sign in to comment.