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
FOUN-1370: add kafka event notification for roomEntry changes #12595
base: Tucana-20.8.0
Are you sure you want to change the base?
Conversation
add kafka event notification for roomEntry changes raise event also if it doesn't require any permission
deployment/updates/scripts/2024_03_03_deploy_kafka_room_events.php
Outdated
Show resolved
Hide resolved
deployment/updates/scripts/2024_03_03_deploy_kafka_room_events.php
Outdated
Show resolved
Hide resolved
@@ -114,7 +114,7 @@ public function dispatch(kScope $scope) | |||
} | |||
|
|||
$requiredPermissions = explode(",", $this->getRequiresPermissions()); | |||
if(count($requiredPermissions)) | |||
if(count(array_filter($requiredPermissions))) |
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 the purpose is to remove all empty values that return true on the empty() function please state the function when calling array_filter. To avoid case where this logic will change in the future.
From PHP doc:
callback
The callback function to use
If no callback is supplied, all empty entries of array will be removed. See empty() for how PHP defines empty in this case.
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.
It isn't possible to pass "empty" to "array_filter" as "empty" is not a function but a language construct
I think I'll use "strlen" which doing the job in our case (the case when $this->getRequiresPermissions() returns null and explode returns array of empty string).
Is it sounds ok for you?
...updates/scripts/xml/notifications/2024_03_03_add_kafka_room_entry_notifications.template.xml
Outdated
Show resolved
Hide resolved
remove un-needed print_r change "@TOPIC_NAME@" to "entry" remove "template" from filename in script use "strlen" for "array_filter" instead of default filter callback
add kafka event notification template for roomEntry changes
raise event also if it doesn't require any permission