29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-05-28 07:53:37 +00:00

Declare the context variable correctly (#42336)

* Declare the context variable correctly

* cs

---------
This commit is contained in:
Allon Moritz 2023-11-18 15:05:52 +01:00 committed by GitHub
parent 0b6137699f
commit 296563b233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,7 @@ use Joomla\CMS\Table\ContentHistory;
use Joomla\CMS\Table\TableInterface;
use Joomla\CMS\Workflow\WorkflowPluginTrait;
use Joomla\CMS\Workflow\WorkflowServiceInterface;
use Joomla\Event\Event;
use Joomla\Event\EventInterface;
use Joomla\Event\SubscriberInterface;
use Joomla\Registry\Registry;
@ -87,6 +88,10 @@ final class Publishing extends CMSPlugin implements SubscriberInterface
*/
public function onContentPrepareForm(EventInterface $event)
{
if (!$event instanceof Event) {
return;
}
[$form, $data] = array_values($event->getArguments());
$context = $form->getName();
@ -352,7 +357,11 @@ final class Publishing extends CMSPlugin implements SubscriberInterface
*/
public function onContentBeforeChangeState(EventInterface $event)
{
[$form, $pks] = array_values($event->getArguments());
if (!$event instanceof Event) {
return;
}
[$context, $pks] = array_values($event->getArguments());
if (!$this->isSupported($context)) {
return true;