-
Notifications
You must be signed in to change notification settings - Fork 224
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
N°5619 - Hide newsroom menu when no provider #363
base: develop
Are you sure you want to change the base?
Conversation
The second commit fixes a crash when there is actually no provider at all (not reproducible on a Community iTop, since there is the iTop Hub provider...) |
sources/application/UI/Base/Component/PopoverMenu/NewsroomMenu/NewsroomMenuFactory.php
Outdated
Show resolved
Hide resolved
@@ -269,7 +270,7 @@ public function GetSubBlocks(): array | |||
*/ | |||
public function IsNewsroomEnabled(): bool | |||
{ | |||
return MetaModel::GetConfig()->Get('newsroom_enabled'); | |||
return (MetaModel::GetConfig()->Get('newsroom_enabled') && NewsroomMenuFactory::HasProviders()); |
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.
But it does work on Essential/Professional products though, are you sure this is the root cause?
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.
According to #363 (comment) it's "crashing". Don't know what exactly he means with that.
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.
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.
Without the second commit it was crashing (during the construction of the iTop WebPage) on Essential/Professional because the (empty) newsroom menu object was not created (because there is not newroom provider on such products).
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.
Discussed with Denis, I could not reproduce the issue on a Professional package. We would like to be able to reproduce the issue in order to ensure the fix is necessary and correct. Denis will dig further to have a reproduction procedure.
The newsroom menu can be hidden by configuration, but is not automatically hidden when there is no newsroom provider installed.
This pull request just hides the menu automatically in such a case.