-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EWPP-842: Allow chart and racing services for webtols chart widget. #152
Conversation
@@ -46,7 +46,7 @@ public function validate($value, Constraint $constraint) { | |||
} | |||
|
|||
// Add violation in case incorrect services. | |||
if (!isset($snippet['service']) || $snippet['service'] !== $widget_types[$constraint->widgetType]['service']) { | |||
if (!isset($snippet['service']) || !in_array($snippet['service'], $widget_types[$constraint->widgetType]['services'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also BC issue here. Check for the presence of services
and if not, case service
to an array and use that. This is in case someone extended the source class.
@@ -125,6 +125,7 @@ public function getWidgetTypes() { | |||
'chart' => [ | |||
'name' => $this->t('Chart'), | |||
'service' => 'charts', | |||
'services' => ['chart', 'racing'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If service
is deprecated then need to provide services
parameter for each widget type as was done in the first commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, all of them need to get services
c727c21
to
e2dab98
Compare
No description provided.