If the Path Redirect module is enabled during profile-based installation it gets called by Pathauto (assuming that's also enabled). The process ultimately calls _path_redirect_build_conditions() which requests the schema with drupal_get_schema(). Unfortunately the schema is not available during installation (#200931: Schema not available in hook_install/hook_enable) which means the function fails and the called Path Redirect functions generate rubbish SQL thus generating errors.

Phew.

The attached patch fixes the problem by checking to see if $schema is still empty after the drupal_get_schema() call, if it is it loads up path_redirect.install and gets the schema directly.

Comments

dave reid’s picture

Status: Needs review » Fixed

Committed an easier fix that just checks if MAINTENANCE_MODE is defined in path_redirect_init:
http://drupal.org/cvs?commit=403442

Status: Fixed » Closed (fixed)

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

ezra-g’s picture

Status: Closed (fixed) » Reviewed & tested by the community

The originally proposed patch here resolved the my issue described in #889630: Path_redirect errors after COD installation. Humbly, marking as RTBC.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, missing-schema-during-install.patch, failed testing.

ezra-g’s picture

Status: Needs work » Needs review
StatusFileSize
new744 bytes

Re-roll.

ezra-g’s picture

Status: Needs review » Reviewed & tested by the community
greggles’s picture

I believe the patch committed in #1 did not fix the problem. On an install profile with path_redirect 6.x-1.0-beta7 (built August 10th, comment #1 and the commit happened on August 6th) I get the error. Applying Ezra's patch fixes the problem.

I ran into this while building hyperlocalnews profile.

If I could RTBC again I would :)

dave reid’s picture

Side note, should we maybe fix where this is being called from as well?

greggles’s picture

I'm not sure how we could fix it where it's getting called. This seems like the most specific place to do some schema helper shenanigans.

Or do you mean that the schema isn't loaded during execution of a .profile and we should fix that?

dave reid’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new912 bytes

Greg and Ezra, could I get either of you to test the following patch which uses the drupal_get_schema_unprocessed() and simplifies the previous patch?

ezra-g’s picture

Status: Needs review » Reviewed & tested by the community

Yes, this resolves the problem when installing COD. Thanks!

dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Great. Committed to CVS, and tagging an RC1 now.
http://drupal.org/cvs?commit=433032

ezra-g’s picture

Hooray! Thanks!

Status: Fixed » Closed (fixed)

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