From c7e65d2db5321af10bbf79403074eea131f5617a Mon Sep 17 00:00:00 2001 From: Kamil Kuzminski Date: Thu, 1 Sep 2022 16:20:11 +0200 Subject: [PATCH 1/2] Update to Contao 5 (composer only for now) --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index db0f237..fe30155 100644 --- a/composer.json +++ b/composer.json @@ -24,8 +24,8 @@ "source": "https://github.com/contao-bootstrap/core" }, "require": { - "php": ">=5.6.0", - "contao/core-bundle": "^4.4.0", + "php": "^7.4 || ^8.0", + "contao/core-bundle": "^4.13 || ^5.0", "netzmacht/contao-leaflet-libraries": "~1.3" }, "require-dev": { From 03668e58520bcb98ec1c28cc61adaa656572e404 Mon Sep 17 00:00:00 2001 From: Kamil Kuzminski Date: Wed, 14 Sep 2022 12:15:03 +0200 Subject: [PATCH 2/2] Fix compatibility with Contao 5 --- src/Widget/GeocodeWidget.php | 10 +++++++--- src/Widget/RadiusWidget.php | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Widget/GeocodeWidget.php b/src/Widget/GeocodeWidget.php index 2d6ba08..5a91d9d 100644 --- a/src/Widget/GeocodeWidget.php +++ b/src/Widget/GeocodeWidget.php @@ -12,13 +12,17 @@ namespace Netzmacht\Contao\Leaflet\GeocodeWidget\Widget; +use Contao\BackendTemplate; +use Contao\StringUtil; +use Contao\Widget; + /** * Class GeocodeWidget * * @property int size * @property bool multiple */ -class GeocodeWidget extends \Widget +class GeocodeWidget extends Widget { /** * Submit user input. @@ -111,12 +115,12 @@ class GeocodeWidget extends \Widget $buffer = ''; for ($index = 0; $index < $this->size; $index++) { - $template = new \BackendTemplate($this->widgetTemplate); + $template = new BackendTemplate($this->widgetTemplate); $template->setData( [ 'wrapperClass' => $wrapperClass, 'widget' => $this, - 'value' => \StringUtil::specialchars($this->value[$index]), + 'value' => StringUtil::specialchars($this->value[$index]), 'class' => $this->strClass ? ' ' . $this->strClass : '', 'id' => $this->strId . (($this->size > 1) ? '_' . $index : ''), 'name' => $this->strName . (($this->size > 1) ? '[]' : ''), diff --git a/src/Widget/RadiusWidget.php b/src/Widget/RadiusWidget.php index c6bf7e2..58ed85f 100644 --- a/src/Widget/RadiusWidget.php +++ b/src/Widget/RadiusWidget.php @@ -13,6 +13,7 @@ namespace Netzmacht\Contao\Leaflet\GeocodeWidget\Widget; use Contao\BackendTemplate; +use Contao\StringUtil; use Contao\TextField; /** @@ -66,7 +67,7 @@ class RadiusWidget extends TextField [ 'wrapperClass' => trim($wrapperClass), 'widget' => $this, - 'value' => \StringUtil::specialchars($this->value[$index]), + 'value' => StringUtil::specialchars($this->value[$index]), 'class' => $this->strClass ? ' ' . $this->strClass : '', 'id' => $this->strId . (($this->size > 1) ? '_' . $index : ''), 'name' => $this->strName . (($this->size > 1) ? '[]' : ''),