Is there any way to avoid this and have it go to the forum's view page?

Can I somehow make forums be excluded from the product module?

I've tried nodegoto but it doesn't make a difference. It doesn't do it to roles that don't have access to products, but I would like it to not do it for the administrator as well because it confuses them.

cheers
alynner

Comments

sime’s picture

Component: other » -- other --
Status: Active » Closed (fixed)

extremely confusing question - forums?

Please reopen if this is still an issue and we'll go through it.

alynner’s picture

Status: Closed (fixed) » Active

yes, it is still a problem and I'll try to explain better!

I am using the subproducts module, so after I add a product it takes me to www.mydomain.com/node/nid/subproducts/generate which is fine. The problem is, that when I submit a FORUM, is also takes me to www.mydomain.com/node/nid/subproducts/generate, but I don't want subproducts of a forum.

Is there a setting for subproducts somewhere that only attaches it to actual products and not forums, pages, etc.?

thanks!
alynner

alt_paul’s picture

I'm having a similar issue. Whenever I make a node of any kind(non-product), and after creating the node, it sends me to the sub-products category. Obviously I don't want that, I want it to send me to the normal place it should go, node specific. If you go to admin/settings/content types, and then configure any node, I have at the top of the node configuration apparell and shippable. That isn't something I want associated with my non-product nodes. It seems like one of the modules, I'm guessing subproducts, is blanketing it's configs on all nodes, not just products nodes.

Anonymous’s picture

+1 Same problem here

wpd’s picture

Component: -- other -- » subproducts

This is the same bug as here:
http://drupal.org/node/83670

Anonymous’s picture

I'm not by any means a programmer but, I'm gonna assume that this is the area that is causing the redirect.

    // Having removed obsolete values, we continue on to insert.
      case 'insert':
        if ($node->product) {
          foreach ($node->variations as $variation) {
            db_query("INSERT INTO {ec_product_attribute} (nid, aid) VALUES (%d, %d)", $node->nid, $variation);
          }
        }
        elseif (subproducts_access('administer', $node)) {
          $_REQUEST['edit']['destination'] = "node/$node->nid/subproducts/generate";
        }
        return;
      case 'delete':

Of course, I don't know if this is the area that is causing the redirect on all nodes, but maybe its a start. Again, I'm not a developer so bare with me.

wpd’s picture

Title: when I submit a forum, it takes me to node/$nid/subproducts/generate » node add is broken for non-product nodes; it redirects to node/$nid/subproducts/generate
Status: Active » Needs review
StatusFileSize
new73.19 KB

This patch fixes it for me. I can still correctly create subproducts (i.e. apparel), but I do not get redirected to the home pages after I create every other node type.

The patch only changes one line (222):

elseif (subproducts_access('administer', $node)) {
to ->
elseif (subproducts_access('administer', $node) && isset($node->ptype)) {
neclimdul’s picture

please read this http://drupal.org/diffandpatch
We aren't going to read over an entire module to review changes. Especially for one line, you're just wasting storage.

wpd’s picture

StatusFileSize
new0 bytes

My apologies. I uploaded the wrong file! Here is the patch file.

advosuzi’s picture

Status: Needs review » Active

+1 for this bug.

i tried applying the above change && isset($node->ptype) change to both lines 222 and 502 and it did not fix the issue.

advosuzi’s picture

Status: Active » Needs review
StatusFileSize
new368 bytes

This patch fixed the problem for me

sime’s picture

seems so simple. can someone else confirm advosuzi's patch and I'll apply

darren oh’s picture

Status: Needs review » Reviewed & tested by the community

It works.

darren oh’s picture

StatusFileSize
new350 bytes

This bug occurs because for some reason $node->ptype is set to 0000. I'm attaching a patch that checks whether ptype is empty instead of whether it is set. A bug somewhere else must be setting the product type.

nedjo’s picture

Probably we should apply this patch as an interim measure (I'll do so unless I hear objections), but it is clearly a workaround that leaves the real problem unaddressed. The problem is that somewhere in the code we're getting an incorrect value set for $node->ptype. The challenge is to find where.

gordon’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)