From 4bd2b374b8d17dc69ccb0a17db10246ecfc36396 Mon Sep 17 00:00:00 2001 From: Leo Feyer Date: Thu, 23 Oct 2014 14:09:35 +0200 Subject: [PATCH 1/2] Always pass a DC object in the `toggleVisibility` callback (see #7314) --- src/Resources/contao/dca/tl_calendar_events.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Resources/contao/dca/tl_calendar_events.php b/src/Resources/contao/dca/tl_calendar_events.php index 3c190bd51c..6ce06d57cf 100644 --- a/src/Resources/contao/dca/tl_calendar_events.php +++ b/src/Resources/contao/dca/tl_calendar_events.php @@ -993,7 +993,7 @@ public function toggleIcon($row, $href, $label, $title, $icon, $attributes) { if (strlen(Input::get('tid'))) { - $this->toggleVisibility(Input::get('tid'), (Input::get('state') == 1)); + $this->toggleVisibility(Input::get('tid'), (Input::get('state') == 1), (@func_get_arg(12) ?: null)); $this->redirect($this->getReferer()); } @@ -1018,8 +1018,9 @@ public function toggleIcon($row, $href, $label, $title, $icon, $attributes) * Disable/enable a user group * @param integer * @param boolean + * @param \DataContainer */ - public function toggleVisibility($intId, $blnVisible) + public function toggleVisibility($intId, $blnVisible, DataContainer $dc=null) { // Check permissions to edit Input::setGet('id', $intId); @@ -1044,11 +1045,11 @@ public function toggleVisibility($intId, $blnVisible) if (is_array($callback)) { $this->import($callback[0]); - $blnVisible = $this->$callback[0]->$callback[1]($blnVisible, $this); + $blnVisible = $this->$callback[0]->$callback[1]($blnVisible, ($dc ?: $this)); } elseif (is_callable($callback)) { - $blnVisible = $callback($blnVisible, $this); + $blnVisible = $callback($blnVisible, ($dc ?: $this)); } } } From 243d3b65cd5c04dcbe9be30922894a1a506d1d4c Mon Sep 17 00:00:00 2001 From: Leo Feyer Date: Fri, 31 Oct 2014 09:54:40 +0100 Subject: [PATCH 2/2] Update the language files --- src/Resources/contao/languages/sl/default.xlf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/contao/languages/sl/default.xlf b/src/Resources/contao/languages/sl/default.xlf index 726ac24d22..ea562a7fa8 100644 --- a/src/Resources/contao/languages/sl/default.xlf +++ b/src/Resources/contao/languages/sl/default.xlf @@ -15,7 +15,7 @@ There are no events on this day. - Ni dogotkov za ta dan. + Ni dogodkov za ta dan. There are no events for this week.