Notice: Use of undefined constant RULES_ADMIN_SET_PATH - assumed 'RULES_ADMIN_SET_PATH' in include_once() (line 11 of
/sites/all/modules/rules/rules_scheduler/rules_scheduler.module).
Notice: Use of undefined constant RULES_ADMIN_PATH - assumed 'RULES_ADMIN_PATH' in include_once() (line 11 of
/sites/all/modules/rules/rules_forms/rules_forms.module).

This seems to be about both rules_forms and rules_scheduler so I started with the scheduler.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

klausi’s picture

Category: bug » support

Looks like the Rules module is not enabled or the scheduler has a lower weight and gets included before Rules itself.

greggles’s picture

Good idea!


mysql> select name, weight, status from system where name like 'rules%';
+-----------------+--------+--------+
| name            | weight | status |
+-----------------+--------+--------+
| rules           |     20 |      1 |
| rules_admin     |      0 |      0 |
| rules_forms     |     20 |      1 |
| rules_scheduler |      0 |      1 |
| rules_test      |      0 |      0 |
+-----------------+--------+--------+

So, I can see now why rules_scheduler is throwing this notice, but not rules_forms. Any ideas?

greggles’s picture

Category: support » feature
Status: Active » Needs review
FileSize
993 bytes

The attached patch helps handle these scenarios.

klausi’s picture

Status: Needs review » Postponed (maintainer needs more info)

This rather solves the symptom, not the underlying problem. The info-files of rules_scheduler and rules_forms clearly state that they depend on rules, so the module system needs to load them first. Either we are dealing with a core bug here or something in your Drupal installation is messed up.

greggles’s picture

so the module system needs to load them first

Perhaps so, but that's not how core works and it still doesn't work like that in Drupal 7 and maybe not Drupal 8.

Pushing this off onto core feels like a cop-out to me, though I don't know enough about why the weights are this way on this site to say that it is "doing it properly."

klausi’s picture

Category: feature » bug
Status: Postponed (maintainer needs more info) » Active

Ah, facepalm. The path constants are defined in rules_admin, which is not activated on your site. Using the scheduler without the Rules user interface has obviously not been a use case for many people.

I suggest that we check in rules_scheduler.module for RULES_ADMIN_SET_PATH and hard code the path if it does not exist.

jhedstrom’s picture

Priority: Normal » Major
Status: Active » Needs review
FileSize
1.24 KB

Re-rolling the patch for p1. Also, bumping to major since this, in combination with drush, syslog, and NOTICE level error reporting, can result in corrupted and partially built theme registries, since the theme registry is built and cached in the middle of module_load_all().

Status: Needs review » Needs work

The last submitted patch, 1103076_reduce_notices_different_weights.patch, failed testing.

apaderno’s picture

Title: Use of undefined constant RULES_ADMIN_SET_PATH and RULES_ADMIN_SET_PATH » Use of undefined constant RULES_ADMIN_SET_PATH and RULES_ADMIN_PATH
jhedstrom’s picture

Status: Needs work » Needs review
FileSize
949 bytes

Oops, here's a patch that actually applies.

fago’s picture

Status: Needs review » Needs work

hm, we should not expose any UI in the other modules too if rules_admin is disabled, i.e. let's wrap hook_menu implementations in a module_exists('rules_admin') check. That way the constants shouldn't be needed any more either.

kenorb’s picture

(removed)

Dane Powell’s picture

Issue summary: View changes

I do believe, like jhedstrom, that this is quite a bit more serious than it seems- I was getting a ton of unexplained WSODs, and bizarre theme-related errors (like update.php trying to use the site theme instead of maintenance theme) until I simply enabled the Rules Admin UI.

ShaneOnABike’s picture

The patch above actually worked for D6.. would it be possible to at least release that patch for D6 users and then find a more appropriate solution for D7/8?

TR’s picture

Status: Needs work » Closed (outdated)

D6 is obsolete and no longer supported, so this will not be fixed in Rules 6.x-1.x at this point.

The RULES_ADMIN_SET_PATH and RULES_ADMIN_PATH constants are not defined or used in the D7 or D8 version of Rules.