-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stable release 2.2.0 This brings full Contao 4.9 support. Additionally there have been performance improvements and various bugfixes. - With the new interface ITranslatedMetaModel it is now possible to use a translated alias for the settings of the attribute at Alias - until now this had to be an attribute with "unique" values - with change to interface ITranslatedMetaModel API expects at method widgetToValue the data value which was selected at attribute at alias - so far fixed to id - widget as readonly now works correctly in the input mask; also in the popup picker - a filter activated in the attribute settings now also affects the output in the VU - e.g. referenced items are no longer output if a filter limits this analogously to the display in the BE
- Loading branch information
Showing
25 changed files
with
860 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,10 @@ exclude: | |
|
||
mapping: | ||
'Andreas Isaak <[email protected]>': 'Andreas Isaak <[email protected]>' | ||
'Stefan Heimes <[email protected]>': 'Stefan Heimes <[email protected]>' | ||
'Ingolf Steinhardt <[email protected]>': | ||
- 'e-spin <[email protected]>' | ||
- 'zonky <[email protected]>' | ||
- 'zonky2 <[email protected]>' | ||
- 'sandokan <[email protected]>' | ||
- 'e-spin <[email protected]>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: MetaModels attribute_select | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- '**-translation' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: [7.4] | ||
contao: [~4.9.0] | ||
|
||
steps: | ||
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Pull source | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# see https://github.com/shivammathur/setup-php | ||
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Setup PHP. | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
|
||
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache composer cache directory | ||
uses: actions/cache@v1 | ||
env: | ||
cache-name: composer-cache-dir | ||
with: | ||
path: ~/.cache/composer | ||
key: ${{ runner.os }}-build-${{ env.cache-name }} | ||
|
||
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache vendor directory | ||
uses: actions/cache@v1 | ||
env: | ||
cache-name: composer-vendor | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Install composer dependencies | ||
run: composer update --prefer-dist --no-interaction --no-suggest | ||
|
||
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Run tests | ||
run: ant -keep-going |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ vendor/ | |
# build | ||
build/ | ||
composer.lock | ||
.phpunit.result.cache |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[![Build Status](https://travis-ci.org/MetaModels/attribute_select.svg)](https://travis-ci.org/MetaModels/attribute_select) | ||
[![Build Status](https://github.com/MetaModels/attribute_select/actions/workflows/diagnostics.yml/badge.svg)](https://github.com/MetaModels/attribute_select/actions) | ||
[![Latest Version tagged](http://img.shields.io/github/tag/MetaModels/attribute_select.svg)](https://github.com/MetaModels/attribute_select/tags) | ||
[![Latest Version on Packagist](http://img.shields.io/packagist/v/MetaModels/attribute_select.svg)](https://packagist.org/packages/MetaModels/attribute_select) | ||
[![Installations via composer per month](http://img.shields.io/packagist/dm/MetaModels/attribute_select.svg)](https://packagist.org/packages/MetaModels/attribute_select) | ||
|
||
Select | ||
====== | ||
|
||
The select attribute | ||
The select attribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,13 @@ | |
"nontranslatable" | ||
], | ||
"type": "contao-bundle", | ||
"homepage": "http://now.metamodel.me/", | ||
"homepage": "https://now.metamodel.me/", | ||
"license": "LGPL-3.0-or-later", | ||
"authors": [ | ||
{ | ||
"name": "Christian Schiffler", | ||
"email": "[email protected]", | ||
"homepage": "http://www.cyberspectrum.de", | ||
"homepage": "https://www.cyberspectrum.de", | ||
"role": "Developer" | ||
}, | ||
{ | ||
|
@@ -27,18 +27,19 @@ | |
"support": { | ||
"email": "[email protected]", | ||
"issues": "https://github.com/MetaModels/attribute_select/issues", | ||
"wiki": "http://de.contaowiki.org/MetaModels", | ||
"wiki": "https://de.contaowiki.org/MetaModels", | ||
"irc": "irc://irc.freenode.org/contao.mm", | ||
"source": "https://github.com/MetaModels/attribute_select" | ||
}, | ||
"require": { | ||
"php": "^7.1", | ||
"contao-community-alliance/dc-general": "^2.1.0", | ||
"php": "^7.4", | ||
"contao-community-alliance/contao-polyfill-bundle": "^1.1.0", | ||
"contao/core-bundle": "^4.4.8", | ||
"metamodels/core": "^2.1", | ||
"symfony/dependency-injection": "^3.3 || ^4.0", | ||
"symfony/http-kernel": "^3.3 || ^4.0" | ||
"contao-community-alliance/dc-general": "^2.2", | ||
"contao/core-bundle": "^4.9.0, <4.13.0", | ||
"doctrine/dbal": "^2.11 || ^3.0", | ||
"metamodels/core": "^2.2", | ||
"symfony/dependency-injection": "^4.4.6", | ||
"symfony/http-kernel": "~4.4.13" | ||
}, | ||
"require-dev": { | ||
"contao/manager-plugin": "^2.1", | ||
|
@@ -61,10 +62,14 @@ | |
"extra": { | ||
"contao-manager-plugin": "MetaModels\\AttributeSelectBundle\\ContaoManager\\Plugin", | ||
"branch-alias": { | ||
"dev-master": "2.1.x-dev" | ||
"dev-feature/2.2.0": "2.2.x-dev" | ||
} | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"contao-components/installer": false, | ||
"contao/manager-plugin": false | ||
}, | ||
"sort-packages": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* This file is part of MetaModels/attribute_select. | ||
* | ||
* (c) 2012-2019 The MetaModels team. | ||
* (c) 2012-2022 The MetaModels team. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -16,7 +16,7 @@ | |
* @author David Molineus <[email protected]> | ||
* @author Sven Baumann <[email protected]> | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @copyright 2012-2019 The MetaModels team. | ||
* @copyright 2012-2022 The MetaModels team. | ||
* @license https://github.com/MetaModels/attribute_select/blob/master/LICENSE LGPL-3.0-or-later | ||
* @filesource | ||
*/ | ||
|
@@ -28,11 +28,7 @@ | |
use MetaModels\AttributeSelectBundle\FilterRule\FilterRuleSelect; | ||
|
||
/** | ||
* This is the abstract base class for handling select attributes. | ||
* | ||
* @package MetaModels | ||
* @subpackage AttributeSelect | ||
* @author Christian Schiffler <[email protected]> | ||
* This is the MetaModelAttribute class for handling select attributes. | ||
*/ | ||
abstract class AbstractSelect extends AbstractHybrid | ||
{ | ||
|
@@ -88,6 +84,16 @@ protected function getIdColumn() | |
return $this->get('select_id') ?: 'id'; | ||
} | ||
|
||
/** | ||
* Determine the correct sort direction to use. | ||
* | ||
* @return string | ||
*/ | ||
protected function getSortDirection() | ||
{ | ||
return $this->get('select_sort'); | ||
} | ||
|
||
/** | ||
* Determine the correct sorting column to use. | ||
* | ||
|
@@ -220,6 +226,7 @@ public function getAttributeSettingNames() | |
'select_column', | ||
'select_alias', | ||
'select_sorting', | ||
'select_sort', | ||
'select_as_radio', | ||
'includeBlankOption', | ||
'submitOnChange', | ||
|
@@ -249,9 +256,9 @@ public function searchFor($strPattern) | |
public function unsetDataFor($arrIds) | ||
{ | ||
$this->connection->createQueryBuilder() | ||
->update($this->getMetaModel()->getTableName()) | ||
->set($this->getColName(), 0) | ||
->where('id IN (:ids)') | ||
->update($this->getMetaModel()->getTableName(), 't') | ||
->set('t.' . $this->getColName(), 0) | ||
->where('t.id IN (:ids)') | ||
->setParameter('ids', $arrIds, Connection::PARAM_STR_ARRAY) | ||
->execute(); | ||
} | ||
|
@@ -279,9 +286,9 @@ public function convertValuesToValueIds($values) | |
} | ||
|
||
return $this->connection->createQueryBuilder() | ||
->select($idColumn) | ||
->from($tableName) | ||
->where($aliasColumn . ' IN (:values)') | ||
->select('t.' . $idColumn) | ||
->from($tableName, 't') | ||
->where('t.' . $aliasColumn . ' IN (:values)') | ||
->setParameter('values', $values, Connection::PARAM_STR_ARRAY) | ||
->execute() | ||
->fetch(\PDO::FETCH_ASSOC); | ||
|
Oops, something went wrong.