agentrickard already posted a fix that apparently got only partially committed. What's missing in current RC3 is the definition of the variable $script, which is what this patch adds.

Comments

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

Oops! Thanks.

smk-ka’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.96 KB

Hm... this function, domain_grant_all(), actually needs some more love.

First: if variable_get('domain_cron_rule', 1) returns a non-null value, we're leaving the big if-elseif-else construct, which means the paths will never been checked. Therefore we have to do the next check as long as $grant is still set to FALSE.

Second, I've removed that obscure $grant['set'] variable, which is a possible cause for this bug report (which I have also observed): half of the function assigns a boolean value to the static variable, whereas the other half assigns to (and expects it to be) an array with only one key, 'set'.

Third, some non-working code has been fixed: $page_match || preg_match($regexp, $_GET['q']); which should actually be assigned to $page_match.

Fourth, I've exchanged the comparison of path alias and original path, to make the call to drupal_get_path_alias() only when the previous check didn't yield a positive result (ie. a performance optimization).

agentrickard’s picture

Nice. A bug report and some code optimization. Will test.

The $grant['set'] piece came in when it appeared that the static $grant check was not being recognized in the code. The isset() function seems to work better when testing arrays.

Have you tested this when adding new paths into the 'Special Page Requests' variable? Try adding a path like "blog/*"

agentrickard’s picture

I can't re-roll the patch right now, but there is an error in this line:

+        if ($path != $_GET['q'])) {

Extra ) causes WSOD.

smk-ka’s picture

I have tested it with a node (node/1) and its path alias (article-1). When adding node/* to the Special Pages, some debugging code showed me the first preg_match() immediately returning a non-zero value when trying to access the node. When adding article* instead, it's the second preg_match() that, after fetching the url alias, yields a positive result.

smk-ka’s picture

StatusFileSize
new1.96 KB

Uh, yes, I had noticed it and uploaded an edited patch shortly after submitting it... reuploading seems to be safer.

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed that this patch does fix the error.

The domain_grant_all() function was getting caught in a recursive loop and, essentially, passing TRUE.

agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thank you very much.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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