4

I have created a rule for logged in members that if they go to the home page it redirects them to a different page. The home page needs to be different for anonymous and authenticated users.

One problem is that my rule is not working. I have created a redirect loop by mistake. This means I can not get to the rules interface to disable the module. I know I could disable the rules module via drush however I will have the same problem when I turn it back on.

I had a quick look in db and see the rules_rules table. However the data is stored as a blob so I can not edit it. Except for deleting my rules what could I do to disable it?

2
  • It always redirects, whatever page you're on?
    – Andy
    Apr 12, 2011 at 15:51
  • Yep. The rule I set up ended matching all pages rather than the home page. So all pages for authenticated users cause a redirection loop.
    – user788
    Apr 12, 2011 at 16:02

4 Answers 4

2

You got a few options.

  • You can try to edit the data by deserializing it with PHP and try to get some meaning out of it. Most likely there is a status which is either 1 or 0.
  • You could delete the rule from the database entirely.
  • You can temporarily modify the rules_invoke_event (rules.module line 249 for 1.4), if you comment out the call_user_func_array call, no rule should be invoked on the site.

Either of these should work, personally I would go for the last one if I had write access to the rules files.

1
  • /sites/all/modules/rules/rules/rules.module Worked for me on D6. Thanks
    – Sepero
    May 30, 2013 at 4:39
1

In Rules 7.x-2.6:

  • In the rules_config table set the active column to 0 for the problematic rule
  • Empty/Truncate the cache_rules table
0

They way i did to revert reload in one of my drupal 6 project.

  1. logged in using ssh to the terminal.
  2. logged in to database.
  3. selected database.
  4. goto rules_rules table.
  5. written sql quary to delete affcting rule.
0

Devel Module module has a nifty setting for this. Install devel module and visit devel/settings, enable the option Display redirection page.

As the description says

When a module executes drupal_goto(), the query log and other developer information is lost. Enabling this setting presents an intermediate page to developers so that the log can be examined before continuing to the destination page.

you can visit the intermediate page in-spite of the redirection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.