-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotfix release 2.3.4 - Fix group per week - Fix show languages at untranslated models in edit mask
- Loading branch information
Showing
10 changed files
with
109 additions
and
62 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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* This file is part of contao-community-alliance/dc-general. | ||
* | ||
* (c) 2013-2022 Contao Community Alliance. | ||
* (c) 2013-2023 Contao Community Alliance. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -17,7 +17,7 @@ | |
* @author Stefan Heimes <[email protected]> | ||
* @author Sven Baumann <[email protected]> | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @copyright 2013-2022 Contao Community Alliance. | ||
* @copyright 2013-2023 Contao Community Alliance. | ||
* @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later | ||
* @filesource | ||
*/ | ||
|
@@ -162,7 +162,7 @@ public function build(ContainerInterface $container, BuildDataDefinitionEvent $e | |
* Register the callback handlers for the given legacy callbacks. | ||
* | ||
* @param EventDispatcherInterface $dispatcher The event dispatcher. | ||
* @param array $callbacks The callbacks to be handled. | ||
* @param list<callable>|callable $callbacks The callbacks to be handled. | ||
* @param string $eventName The event to be registered to. | ||
* @param array $arguments The arguments to pass to the constructor. | ||
* @param class-string $listener The listener class to use. | ||
|
@@ -175,14 +175,11 @@ public function build(ContainerInterface $container, BuildDataDefinitionEvent $e | |
*/ | ||
protected function parseCallback($dispatcher, $callbacks, $eventName, $arguments, $listener) | ||
{ | ||
if (!(is_array($callbacks) || is_callable($callbacks))) { | ||
return; | ||
} | ||
|
||
// If only one callback given, ensure the loop below handles it correctly. | ||
if (is_array($callbacks) && (2 === count($callbacks)) && !is_array($callbacks[0])) { | ||
if (is_array($callbacks) && (2 === count($callbacks)) && !is_array($callbacks[0] ?? [])) { | ||
$callbacks = [$callbacks]; | ||
} | ||
|
||
foreach ((array) $callbacks as $callback) { | ||
if ($this->isCallbackBlacklisted($callback, $listener)) { | ||
continue; | ||
|
@@ -198,17 +195,17 @@ protected function parseCallback($dispatcher, $callbacks, $eventName, $arguments | |
/** | ||
* Check if callback is blacklisted. | ||
* | ||
* @param mixed $callback The callback. | ||
* @param string $listener The listener class. | ||
* @param mixed $callback The callback. | ||
* @param class-string $listener The listener class. | ||
* | ||
* @return bool | ||
*/ | ||
private function isCallbackBlacklisted($callback, $listener) | ||
private function isCallbackBlacklisted(mixed $callback, string $listener): bool | ||
{ | ||
return ((ContainerOnLoadCallbackListener::class === $listener) | ||
&& is_array($callback) | ||
&& ('checkPermission' === $callback[1]) | ||
&& (0 === strpos($callback[0], 'tl_'))); | ||
&& (str_starts_with($callback[0], 'tl_'))); | ||
} | ||
|
||
/** | ||
|
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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* This file is part of contao-community-alliance/dc-general. | ||
* | ||
* (c) 2013-2019 Contao Community Alliance. | ||
* (c) 2013-2023 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 @@ | |
* @author David Molineus <[email protected]> | ||
* @author Christian Schiffler <[email protected]> | ||
* @author Sven Baumann <[email protected]> | ||
* @copyright 2013-2019 Contao Community Alliance. | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @copyright 2013-2023 Contao Community Alliance. | ||
* @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later | ||
* @filesource | ||
*/ | ||
|
@@ -91,6 +92,9 @@ public function getEnvironment() | |
public function getModel() | ||
{ | ||
assert($this->dataContainer instanceof DcCompat); | ||
return $this->dataContainer->getModel(); | ||
$model = $this->dataContainer->getModel(); | ||
assert($model instanceof ModelInterface); | ||
|
||
return $model; | ||
} | ||
} |
Oops, something went wrong.