Hi,

I'm currently working with both project and project_issue dev versions. If I now activate the organic groups module the creation of issues is not possible any more. The message I get when viewing is 'warning: preg_match() expects parameter 2 to be string, array given in .... \Drupal\includes\bootstrap.inc on line 761.' . While trying to edit it I am redirected to the submit a new issue page with the error 'Invalid project selected.'.

Have the project modules been tested in an environment where organic groups was enabled?

I hope this problem can be fixed because I want to provide a bug tracking portal for several customers where no one can see the projects of the other one and for this purpose I wanted to use organic groups which seems broken together with the project module.

CommentFileSizeAuthor
#18 project_issue-376377-15.patch1.49 KBjrb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcp’s picture

After activating og and attempting to add an issue, I'm seeing:

Call to undefined function project_project_nodeapi() in /var/www/html/sites/bonzoproject/sites/all/modules/project/project.module on line 594

The undefined function is in project.inc. Not sure why it's not getting loaded.

I'd get rid of the critical designation on this, but it does seem to make a site with project and og on it unusable right now.

marcp’s picture

The problem is that og_init() does some loading of nodes before project_init() gets a chance to run and include project.inc. The project module's weight is set to 2 so it goes after og. There must be a good reason for this, so I don't think fiddling with weights is the answer.

I'm not sure og should really be loading up nodes in hook_init(), though there are no restrictions or warnings against doing so.

I guess that means project.inc needs to [somehow] get included earlier in the process, or project_project_nodeapi() should be moved into project.module.

dww’s picture

project's current handling of .inc files is completely brain-dead. See #390856: Do a proper page/code split of project.

dww’s picture

Assigned: Unassigned » dww

I committed an initial fix for this: http://drupal.org/cvs?commit=192590 Can y'all try again with OG + issues and see if that solved it? Thanks.

Andreas Schmidt’s picture

Problem with project_project_nodeapi() seems to be solved but adding issues causes the preg_match error. Editing issues is impossible as there is a "invalid project selected" error like it did before.

Also the links on the project page have a double-escape sequence. I'm using IIS and this causes a server error. Is this a problem on my side or is it possible to change the links from "/node/add/project-issue/%252Ffeature" to "/node/add/project-issue/feature".

I don't know if this is related to organic groups but in the first time is used the project and project_issue modules there were no problems with both of these things.

dww’s picture

Assigned: dww » Unassigned

Alas. Oh well, I'm not surprised OG + project + project_issue are having troubles in D6. I haven't tested that combination at all yet. However, I don't really have time to work on a fully reconciliation in the short term, so I'm unassigning myself again in case anyone else wants to pick up the torch and run with it in the meantime.

meba’s picture

The problem is still in og_init(), currently in:

  // Set group context and language if needed.
  if ($group_node = og_determine_context()) {
    og_set_theme($group_node);
    og_set_group_context($group_node);
    // TODOL: is this too late for menu links and such?
    og_set_language($group_node);
  }

Basically, it causes project_project_load() to be skipped, therefore the system doesn't have $node->project information and everything is screwed. I am still investigating it, if anybody has a clue, let me know.

meba’s picture

Seems to be fixed if I change the weight of project module above og:

mysql> update system set weight=-10 where name = 'project';
mchelen’s picture

changing project module weight fixes undefined function error, still seeing preg_match error

jshuster@drupal.org’s picture

Subscribing ...

dennys’s picture

I have the same problem too. When I view an issue, I got the error

preg_match() expects parameter 2 to be string, array given in /www/includes/bootstrap.inc on line 771.

And when I tried to edit it, I cannot and got "Invalid project selected." message.

fuzzy_texan’s picture

pvhee’s picture

subscribing

Transmitter’s picture

subscribing

jrb’s picture

I think I've got a fix for this (for me, at least). The problem seems to be that the project_issue_load() hook isn't being called when og is present. I think this is due to the way that includes are handled in project_issues.

I've fixed it by moving the function project_issue_load() from issue.inc to project_issue.module.

I'll try to submit a patch soon.

mrfelton’s picture

I'm seeing similar problems when the menu_breadcrumb module is enabled - #454682: Issues with project and menu_breadcrumb integration.

mrfelton’s picture

For the record, I did exactly the as jrbeaton in #15 to fix the same issue in project.module. I moved project_project_load() from project.inc to project.module, and now $node->project is populated properly even when og is enabled.

jrb’s picture

Status: Active » Needs review
FileSize
1.49 KB

Here's the patch from #15 above.

ezra-g’s picture

I confirm this error on a fresh install and this patch resolves the error and og and project associations are properly stored.

The title of this issue has "integration" but the content seems to really about fixing a conflict between the two modules. Should more complete integration between project and og (like not having to specify both associations for each issue) happen in #457622: Port to Drupal 6?

@dww: In that issue you referred us back this one, but this task seems large and specific enough to happen in its own project. Thoughts?

dww’s picture

Title: Issue organic group integration » Issue + organic group incompatibility
Assigned: Unassigned » dww
Status: Needs review » Fixed

Worked on this today while I was on a plane to NYC. Just got my laptop back online and committed a few fixes:

http://drupal.org/cvs?commit=225324
http://drupal.org/cvs?commit=225326

In my testing, that actually makes it work with you enable OG and project* on a test site, and turn project nodes into groups. I needed to move hook_access() in addition to hook_load().

There's still a lot more work to do over at #405478: Do a proper page/code split of project_issue and #390856: Do a proper page/code split of project (I've got a bunch of patches to commit for #405478 that I also did on the plane, but I'll probably post a message for feedback on the proposed split before I commit them), but at least it's basically working now.

@ezra: Yes, #457622: Port to Drupal 6 is exactly the right place to put code so that:
- if you make each project an OG, then issues that are assigned to a given project automatically use that group as their audience
- the "Create issue" link in the group block includes the project name in the URL
- etc...
Let's meet over there.

Therefore, I'm marking this fixed. If there are still problems, let me know and we can decide where to best address them.

Sorry for the delays on this... OG + project* is one of my big visions for the future. ;)

moshe weitzman’s picture

I am willing to commit changes to OG where we are getting in the way of the big vision.

dww’s picture

@moshe: Thanks. I might take you up on that. ;) So far, so good.

Status: Fixed » Closed (fixed)
Issue tags: -6.x-1.0 blocker

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