-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
12 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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* This file is part of contao-community-alliance/events-contao-bindings | ||
* | ||
* (c) 2014-2018 The Contao Community Alliance | ||
* (c) 2014-2024 The Contao Community Alliance | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -14,7 +14,8 @@ | |
* @subpackage Subscribers | ||
* @author Christian Schiffler <[email protected]> | ||
* @author Sven Baumann <[email protected]> | ||
* @copyright 2018 The Contao Community Alliance. | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @copyright 2014-2024 The Contao Community Alliance. | ||
* @license https://github.com/contao-community-alliance/events-contao-bindings/blob/master/LICENSE LGPL-3.0 | ||
* @filesource | ||
*/ | ||
|
@@ -70,16 +71,20 @@ public function handleGetAttributesFromDca(GetAttributesFromDcaEvent $event): vo | |
* @psalm-suppress InternalMethod - getAdapter is the official way and NOT internal. | ||
*/ | ||
$widgetAdapter = $this->framework->getAdapter(Widget::class); | ||
|
||
$event->setResult( | ||
$widgetAdapter->getAttributesFromDca( | ||
$event->getFieldConfiguration(), | ||
$event->getWidgetName(), | ||
$event->getValue(), | ||
$event->getWidgetId(), | ||
$event->getTable(), | ||
$event->getDataContainer() | ||
) | ||
$result = $widgetAdapter->getAttributesFromDca( | ||
$event->getFieldConfiguration(), | ||
$event->getWidgetName(), | ||
$event->getValue(), | ||
$event->getWidgetId(), | ||
$event->getTable(), | ||
$event->getDataContainer() | ||
); | ||
|
||
// Bugfix: Contao does not validate for label array when determining the description. | ||
if (strlen($result['description']) === 1 && !\is_array($event->getFieldConfiguration()['label'] ?? null)) { | ||
$result['description'] = ''; | ||
} | ||
|
||
$event->setResult($result); | ||
} | ||
} |