Skip to content
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

Project not found instead of not specified #1447

Open
wants to merge 1 commit into
base: master
from

Conversation

@vboctor
Copy link
Member

commented Jan 21, 2019

If project id or name is specified but not found, show proper error message.

Fixes #25360

If project id or name is specified but not found, show proper error message.

Fixes #25360
@vboctor vboctor self-assigned this Jan 21, 2019
throw new ClientException(
'Project not specified',
ERROR_EMPTY_FIELD,
array( 'project' ) );
}
if( !project_exists( $t_project_id ) ) {
if( $t_project_id == ALL_PROJECTS ) {
if( isset( $t_issue['project']['id'] ) && !is_blank( isset( $t_issue['project']['id'] ) ) ) {

This comment has been minimized.

Copy link
@atrol

atrol Jan 21, 2019

Member

I don't understand what you want with!is_blank( isset ...
Test if a boolean is not blank?

throw new ClientException(
'Project not specified',
ERROR_EMPTY_FIELD,
array( 'project' ) );
}
if( !project_exists( $t_project_id ) ) {
if( $t_project_id == ALL_PROJECTS ) {
if( isset( $t_issue['project']['id'] ) && !is_blank( isset( $t_issue['project']['id'] ) ) ) {
$t_project_id = isset( $t_issue['project']['id'] );

This comment has been minimized.

Copy link
@atrol

atrol Jan 21, 2019

Member

What's the purpose of assigning a boolean to a project id?

} else if( isset( $t_issue['project']['name'] ) && !is_blank( isset( $t_issue['project']['name'] ) ) ) {
$t_project_id = $t_issue['project']['name'];
} else {
$t_project_id = ALL_PROJECTS;

This comment has been minimized.

Copy link
@atrol

atrol Jan 21, 2019

Member

No need to assign it again as the code block starts with if( $t_project_id == ALL_PROJECTS ) {

@dregad

This comment has been minimized.

Copy link
Member

commented Mar 8, 2019

@vboctor are you going to address atrol's review comments ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.