Need a function to determine whether or not a node or a node type includes the fields necessary to function as a project.

This provides that and in theory would allow it to work with different entity types at some point in the future. This uses the field cache if present so should not be too expensive of a request.

Related Issues

This issue is dependent upon #1569524: Add a 'Project settings' tab on node type edit forms being fixed first.

Level Of Effort

It is estimated to take ___ days of effort to complete this task.

Comments

dww’s picture

Status: Needs review » Needs work
Issue tags: +project, +drupal.org D7

Cool, thanks! Looks like function name mismatch: project_node_type_is_project() vs. project_entity_bundle_is_project().

mikey_p’s picture

Committed to 7.x-2.x with tests.

mikey_p’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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

dww’s picture

Assigned: Unassigned » dww
Status: Closed (fixed) » Needs work

Between this and the stuff chx introduced over at #1548222: node/add/project-issue/%project I think we're getting into dangerous territory here. We're trying to build an API that doesn't assume nodes and could someday handle it if other entity types were "projectable." However, we're actually still assuming nodes in a lot of ways, and I don't think it's ultimately going to work to allow arbitrary entities to be projects. I think it's going to be cleaner and simpler to just embrace our reliance on nodes and not try (and fail) to be overly generic. See my patch at #1580178-3: Add helper functions to handle multiple node types behaving as issues for an example of what I mean. We're still going to use the presence of the field_project_type to know if a given node type is a project or not, but let's not kid ourselves with all this talk of entity bundles. ;)

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new4.32 KB

Like this. Any objections?

Status: Needs review » Needs work

The last submitted patch, 1549538-6.project_node_type_cleanup.patch, failed testing.

dww’s picture

Assigned: dww » Unassigned
Status: Needs work » Closed (fixed)

Bah. mikey_p posted a nearly identical patch at #1586210: Clean up confusion where we appear to support more entity types. Let's continue there...

dww’s picture

Status: Closed (fixed) » Needs work

I'm going to reopen this since now that we're getting into implementation, I'm realizing I'm not happy with our choice that the project-ness of a node type is determined by the presence of field_project_type and forcing everyone to have this sandbox vs. full thing that most sites aren't going to care about at all. Instead see my proposal at #1569524: Add a 'Project settings' tab on node type edit forms (I just updated the summary there).

So, once that UI works, we're going to have to fix the functions we added here.

dww’s picture

Assigned: Unassigned » dww
Status: Needs work » Fixed

I just pushed a fix for this (09f1147) now that #1569524: Add a 'Project settings' tab on node type edit forms is done.

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

Anonymous’s picture

Issue summary: View changes

Adding a Related Issues section.