-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Bug: PHP Notice: Trying to access array offset on value of type null #14
Comments
@creecros I think Should it be:
|
oh wait... it could be the language strings |
I am still on my phone, but would say none are correct.
the only event parameter you have is task. with what you have. you would need to use the project model to grab the project before calling name. like you did here
and this is confusing, don't call this project_id, it's project.
actually, now I think I see your issue. the last one is correct, I just don't like the confusing variable name, and then you used that confusion the second time on line 71. that's where your array to string issue is, because $project_id is not a string, that's an array. |
Does 8b9b031 fix it? |
@creecros any advice how to call the project name based on the last comment? |
and |
It still doesnt work, I think my // SUBJECT OPTIONS
if ($this->getParam('check_box_include_title') == true ) {
// TASK TITLE // Subject becomes: `subject` `task title` `task id`
$subject = $this->getParam('subject') . ": " . $data['task']['title'] . " (#" . $data['task']['id'] . ")";
} elseif ($this->getParam('check_box_include_project') == true ) {
// PROJECT NAME // Subject becomes: `subject` `project name` `task title` `task id`
$project = $this->projectModel->getById($data['task']['project_id']);
$subject = $this->getParam('subject') . ": " . $project['name'] . " " . $data['task']['title'] . " (#" . $data['task']['id'] . ")";
} elseif ($this->getParam('check_box_include_title') == true && $this->getParam('check_box_include_project_identifier')) {
// PROJECT IDENTIFIER // Subject becomes: `subject` `project identifier`
$project = $this->projectModel->getById($data['task']['project_id']);
$subject = $this->getParam('subject') . ": " . $project['identifier'];
} elseif ($this->getParam('check_box_include_title') == true && $this->getParam('check_box_include_project_identifier')) {
// PROJECT IDENTIFIER + TITLE // Subject becomes: `subject` `project identifier` `task title` `task id`
$project = $this->projectModel->getById($data['task']['project_id']);
$subject = $this->getParam('subject') . ": " . $project['identifier'] . " " . $data['task']['title'] . " (#" . $data['task']['id'] . ")";
} elseif ($this->getParam('check_box_include_project') == true && $this->getParam('check_box_include_project_identifier')) {
// PROJECT NAME + PROJECT IDENTIFIER // Subject becomes: `subject` `project identifier`
$project = $this->projectModel->getById($data['task']['project_id']);
$subject = $this->getParam('subject') . ": " . $project['name'] . " " . $project['identifier'];
} elseif ($this->getParam('check_box_include_title') == true && $this->getParam('check_box_include_project')) {
// PROJECT NAME + TITLE // Subject becomes: `subject` `project name` `task title` `task id`
$project = $this->projectModel->getById($data['task']['project_id']);
$subject = $this->getParam('subject') . ": " . $project['name'] . " " . $data['task']['title'] . " (#" . $data['task']['id'] . ")";
} elseif ($this->getParam('check_box_include_title') == true && $this->getParam('check_box_include_project_identifier') && $this->getParam('check_box_include_project')) {
// PROJECT NAME + PROJECT IDENTIFIER + TITLE // Subject becomes: `subject` `project name` `project identifier` `task title` `task id`
$project = $this->projectModel->getById($data['task']['project_id']);
$subject = $this->getParam('subject') . ": " . $project['name'] . " " .$project['identifier'] . " " . $data['task']['title'] . " (#" . $data['task']['id'] . ")";
} else {
// NO SELECTION // Subject becomes: `subject`
$subject = $this->getParam('subject');
} |
@creecros am I right, the above code should be edited as:
|
I'll have to play with it. too much for me to comprehend on my phone. I just haven't had the motivation as of yet. it's tough to get away from wife and kids on the weekends to sit down on a computer. |
I understand, based on what you previously once told me, the Currently, I think it stops at the first |
I would say, you are correct, if it hits the first |
great, so I need to code it backwards with the most restrictive (less likely option used) first, and the free option (task title+id) as the last... I will work on this tonight, I think I have a solution in my head |
well, that could work, but the correct way to fix would be to make it bullet proof. couple ways to do that, but basically, the easiest would be very specific in the statement. example: see the difference? also, another method would be to nest the if statements. example:
and yet another method would be just make them all ifs, no else ifs. |
example:
To get |
no, this is a on its own
in English, its: if you are specific and account for all possibilities, there is no need for an else, just the else ifs. so your next else if would be: followed by then and so forth....until all possible outcomes have been covered. |
For Project Name / Project Identifier, getting the following error:
KanboardEmailHistory/Action/EmailTaskHistory.php
Line 72 in bf399c5
Relates to: #7 Use Project Name & Identifier in Email Subject
The text was updated successfully, but these errors were encountered: