Skip to content

Commit

Permalink
bug #653 [Turbo] Fix checking "topics" option in Broadcaster (wooky)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.x branch.

Discussion
----------

[Turbo] Fix checking "topics" option in Broadcaster

Mercure Broadcaster class was checking for the "topic" option, which is incorrect. This fixes that by checking for "topics" option instead.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Features and deprecations must be submitted against branch main.
-->

Commits
-------

17129ec [Turbo] Fix checking "topics" option in Broadcaster
  • Loading branch information
weaverryan committed Jan 20, 2023
2 parents 88d9a0f + 17129ec commit 57deb64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Turbo/src/Bridge/Mercure/Broadcaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function broadcast(object $entity, string $action, array $options): void
throw new \InvalidArgumentException(sprintf('Cannot broadcast entity of class "%s" as option "rendered_action" is missing.', $entityClass));
}

if (!isset($options['topic']) && !isset($options['id'])) {
if (!isset($options['topics']) && !isset($options['id'])) {
throw new \InvalidArgumentException(sprintf('Cannot broadcast entity of class "%s": either option "topics" or "id" is missing, or the PropertyAccess component is not installed. Try running "composer require property-access".', $entityClass));
}

Expand Down

0 comments on commit 57deb64

Please sign in to comment.