Skip to content

Commit

Permalink
Merge tag '2.2.0'
Browse files Browse the repository at this point in the history
Stable release 2.2.0
      This brings full Contao 4.9 support.

Additionally there have been performance improvements
and various bugfixes.
  • Loading branch information
baumannsven committed Nov 17, 2022
2 parents 9eb5dba + 2b5a40c commit 13a84f1
Show file tree
Hide file tree
Showing 17 changed files with 537 additions and 158 deletions.
4 changes: 4 additions & 0 deletions .check-author.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ mapping:
- 'cboelter <[email protected]>'
- 'Christopher Boelter <[email protected]>'
- 'Christopher Bölter <[email protected]>'
'Ingolf Steinhardt <[email protected]>':
- 'xantippe <[email protected]>'
- 'zonky2 <[email protected]>'
- 'zonky <[email protected]>'
52 changes: 52 additions & 0 deletions .github/workflows/diagnostics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: MetaModels attribute_text

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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ vendor/
composer.lock

# build
build/
build/
.phpunit.result.cache
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[![Build Status](https://travis-ci.org/MetaModels/attribute_text.svg)](https://travis-ci.org/MetaModels/attribute_text)
[![Build Status](https://github.com/MetaModels/attribute_text/actions/workflows/diagnostics.yml/badge.svg)](https://github.com/MetaModels/attribute_text/actions)
[![Latest Version tagged](http://img.shields.io/github/tag/MetaModels/attribute_text.svg)](https://github.com/MetaModels/attribute_text/tags)
[![Latest Version on Packagist](http://img.shields.io/packagist/v/MetaModels/attribute_text.svg)](https://packagist.org/packages/MetaModels/attribute_text)
[![Installations via composer per month](http://img.shields.io/packagist/dm/MetaModels/attribute_text.svg)](https://packagist.org/packages/MetaModels/attribute_text)

Text
====

The text attribute
The text attribute.
25 changes: 15 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand All @@ -27,18 +27,19 @@
"support": {
"email": "[email protected]",
"issues": "https://github.com/MetaModels/attribute_text/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_text"
},
"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",
Expand All @@ -61,10 +62,14 @@
"extra": {
"contao-manager-plugin": "MetaModels\\AttributeTextBundle\\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
}
}
37 changes: 21 additions & 16 deletions src/Attribute/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of MetaModels/attribute_text.
*
* (c) 2012-2019 The MetaModels team.
* (c) 2012-2021 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -16,7 +16,7 @@
* @author Christopher Boelter <[email protected]>
* @author Ingolf Steinhardt <[email protected]>
* @author David Molineus <[email protected]>
* @copyright 2012-2019 The MetaModels team.
* @copyright 2012-2021 The MetaModels team.
* @license https://github.com/MetaModels/attribute_text/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
Expand All @@ -35,6 +35,7 @@ class Text extends BaseSimple
*/
public function getSQLDataType()
{
// Note the maxlength in getFieldDefinition.
return 'varchar(255) NULL';
}

Expand All @@ -43,30 +44,34 @@ public function getSQLDataType()
*/
public function getAttributeSettingNames()
{
return array_merge(parent::getAttributeSettingNames(), array(
'isunique',
'searchable',
'filterable',
'mandatory',
'allowHtml',
'preserveTags',
'decodeEntities',
'trailingSlash',
'spaceToUnderscore',
'rgxp'
));
return array_merge(
parent::getAttributeSettingNames(),
[
'isunique',
'searchable',
'filterable',
'mandatory',
'allowHtml',
'preserveTags',
'decodeEntities',
'trailingSlash',
'spaceToUnderscore',
'rgxp'
]
);
}

/**
* {@inheritdoc}
*/
public function getFieldDefinition($arrOverrides = array())
public function getFieldDefinition($arrOverrides = [])
{
$arrFieldDef = parent::getFieldDefinition($arrOverrides);
$arrFieldDef['inputType'] = 'text';

if ($arrOverrides['rgxp']) {
$arrFieldDef['eval']['rgxp'] = $arrOverrides['rgxp'];
$arrFieldDef['eval']['rgxp'] = $arrOverrides['rgxp'];
$arrFieldDef['eval']['maxlength'] = '255';
}

return $arrFieldDef;
Expand Down
32 changes: 22 additions & 10 deletions src/EventListener/BackendEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of MetaModels/attribute_text.
*
* (c) 2012-2019 The MetaModels team.
* (c) 2012-2020 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -15,7 +15,7 @@
* @author Christopher Boelter <[email protected]>
* @author Ingolf Steinhardt <[email protected]>
* @author David Molineus <[email protected]>
* @copyright 2012-2019 The MetaModels team.
* @copyright 2012-2020 The MetaModels team.
* @license https://github.com/MetaModels/attribute_text/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
Expand Down Expand Up @@ -44,14 +44,26 @@ public function getRgxpOptions(GetPropertyOptionsEvent $event)
}

$options = array(
'alnum' => 'alnum',
'alpha' => 'alpha',
'digit' => 'digit',
'email' => 'email',
'emails' => 'emails',
'extnd' => 'extnd',
'friendly' => 'friendly',
'phone' => 'phone',
'digit' => 'digit',
'natural' => 'natural',
'alpha' => 'alpha',
'alnum' => 'alnum',
'extnd' => 'extnd',
'date' => 'date',
'time' => 'time',
'datim' => 'datim',
'friendly' => 'friendly',
'email' => 'email',
'emails' => 'emails',
'url' => 'url',
'alias' => 'alias',
'folderalias' => 'folderalias',
'phone' => 'phone',
'prcnt' => 'prcnt',
'locale' => 'locale',
'language' => 'language',
'google+' => 'google+',
'fieldname' => 'fieldname'
);

$event->setOptions($options);
Expand Down
Loading

0 comments on commit 13a84f1

Please sign in to comment.