Subtask of #1569988: [Meta] Project issue settings D7 cleanup.

Now that #1569524: Add a 'Project settings' tab on node type edit forms is done, we can actually go back and cleanup the weird 'Project issue' checkbox on the node type edit form by having project_issue implement hook_project_node_type_settings().

So, this issue should:

  • Remove the project_issue_[node_type] checkbox setting from the UI
  • Implement hook_project_node_type_settings() to at least provide a #behavior_label like t('Used for project issues')
  • Fix the places in project_issue that referred to the old setting to use project_behavior_[node-type] instead.

Initially assigning this to ChinggizKhan. If that's not right, please assign it back to me or something. ;)

Thanks!
-Derek

Comments

dww’s picture

Assigned: iamcarrico » Unassigned

Actually, Ian isn't going to have any time to work on this in the near future, so this is available if someone else wants to claim it. Or, he'll claim it back if he's going to start on a patch.

iamcarrico’s picture

Assigned: Unassigned » iamcarrico

Hey! Guess what? I have more time... so I will get working on this.

iamcarrico’s picture

Status: Active » Needs review
StatusFileSize
new1.13 KB

I want to put a staples button on this post... "That was easy".

Although I generally disagree with having a sole settings option for determining if a node is related to the project module solely off of the variable, this will work as it is requested. Personally, I think it should be based on if fields are present... much like the og module.

dww’s picture

Status: Needs review » Needs work

Thanks. However, please read the original post and handle all the things I spelled out there. This only implements the hook and touches one place that was referring to the old setting. We still need to remove the old checkbox entirely, fix project_issue_issue_node_types(), etc, etc.

iamcarrico’s picture

Status: Needs work » Needs review
StatusFileSize
new1.72 KB

Ah, I assumed that all the settings went through the pre-made function to check if a project is an issue. It seems only project_issue_issue_node_types() was the only rogue function, the rest go through project_issue_node_type_is_issue(). The checkbox was already removed.

dww’s picture

Status: Needs review » Fixed

Yeah, grep is your friend. ;) But yeah, good move to just have all those helpers go through the same place. I already fixed that in project and project_release, but I didn't want to touch that here so it wouldn't conflict.

The checkbox itself was gone, but the submit handler was still around. Thanks for removing that, too.

#5 included a syntax error:

Parse error: syntax error, unexpected '{' in project_issue.module on line 1709
Errors parsing project_issue.module

but I just fixed that locally before pushing.

Committed and pushed to 7.x-2.x.

Thanks!
-Derek

senpai’s picture

Issue tags: +sprint 4

Tagging for Sprint 4.

damien tournoud’s picture

Status: Fixed » Needs work

I guess the project_behavior_project_issue variable now needs to be set somewhere.

dww’s picture

Status: Needs work » Fixed

That's set by core. @see node_type_form_submit().

damien tournoud’s picture

Status: Fixed » Needs review
StatusFileSize
new595 bytes

Except that it is not for the project_issue node type created during the installation.

dww’s picture

Status: Needs review » Fixed

Yes, I just realized that's what you were talking about and came to commit something like this. ;)

After the patch:

% find . | xargs egrep -i project_issue_project_issue
./project_issue.module:function project_issue_project_issue_assignees($issue, $project, $current) {

Committed 7781943 and pushed to 7.x-2.x.

Thanks!
-Derek

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

iamcarrico’s picture

Assigned: iamcarrico » Unassigned