1

Subsequent to what I saw in the question 'Don't calculate shipping for specific item', I tried to create a rule with a conditional action (screen capture below), but it causes 404 error:

enter image description here

The export for the rule looks like so:

{ "rules_test_please_delete_" : {
  "LABEL" : "Test (please delete)",
  "PLUGIN" : "reaction rule",
  "OWNER" : "rules",
  "REQUIRES" : [ "rules_conditional", "rules" ],
  "ON" : { "node_delete--page" : { "bundle" : "page" } },
  "DO" : [ { "CONDITIONAL" : [] } ]
}
}

How can I fix the 404 error?

Related resources:

0

Not sure (yet) what is causing your 404 error, but at this point I'm not convinced it is a bug ...

I imported your exported rule in my own site to experiment with it, this is what happened:

  • The import worked fine (of course), so I started from the very same Rule as your exported rule.
  • I then used the Rules UI to also add such "If", and then just show a Bingo-message on the site.
  • If I would want to add another "if", the URL that would be used for that would have relative path "/admin/config/workflow/rules/reaction/manage/rules_attempt_to_recreate_a_404_error/add/3/if".

Here is the proof of my experiment (an exported Rule, which includes some additional logic within that Conditional Rules Action, and for which I changed the label and machine name also, though only after I imported the rule):

{ "rules_attempt_to_recreate_a_404_error" : {
    "LABEL" : "Attempt to recreate a 404 error",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules_conditional", "rules" ],
    "ON" : { "node_delete--page" : { "bundle" : "page" } },
    "DO" : [
      { "CONDITIONAL" : [
          {
            "IF" : { "NOT data_is" : { "data" : [ "node:promote" ], "value" : "1" } },
            "DO" : [
              { "drupal_message" : { "message" : "Bingo, this one seems to work ... using \u0022Conditional Rules\u0022 ..." } }
            ]
          }
        ]
      }
    ]
  }
}

The scenario described above was completed in a Drupal 7.5x site, using these versions of related modules:

  • Rules: 7.x-2.9
  • Conditional Rules: 7.x-1.0-beta2

I suggest you try to import "my" rule here in your site, and see if you get any other messages while trying to perform that import.

To further pinpoint your issue, have a look at the typical Drupal logging information, you may find there some other indication about what's happening in your site around the time the 404 error occurs.

Notes:

  1. I'm not sure if it could be an explanation for your issue (what it is that causes it), but I noticed that your scenario uses https://, while my scenario was performed using http:// ... Debugging is the art of taking away all possible causes for an issue, so you may want to try in a site using http:// instead of https:// ... FYI: I tried a similar scenario using https://, and did not encounter any problem or 404 error.
  2. As an alternative to using the Conditional Rules module, you can also create corresponding Rules Components, with similar Rules Actions to be performed. For more details on that, refer to the answer to "What's the alternative to using the Conditional Rules module?".
  • What versions of Drupal, Rules, and Conditional Rules are you using? – Brylie Christopher Oxley Sep 1 '17 at 11:24
  • I double checked my Drupal logs, and it shows only the 'page not found' at the time when I was seeing the 404 page. What does your URL bar show when you click 'add if'? – Brylie Christopher Oxley Sep 1 '17 at 11:29
  • @BrylieChristopherOxley check my updated answer to address your prior comments. And for sure also my note "1." ... (you never know ...). BTW: did you notice all comments below my answer to the linked question got removed ... Good for you that you did accept my advice to create a new question ... – Pierre.Vriens Sep 1 '17 at 12:32
  • do you have clean URLs enabled? – Brylie Christopher Oxley Sep 3 '17 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.