Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pifagor created an issue. See original summary.

pifagor’s picture

xjm’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: -2432997 +Needs tests

Hi @pifagor, thanks for reporting this!

Instead of adding the require, can you move the constants into the .install file? They should be there instead of in the .module file.

Also, it's very surprising that this error has been around so long! Is the taxonomy access schema even being created correctly? We should add automated test coverage to ensure the database schema is created correctly on installation, with the correct values.

xjm’s picture

Title: Removing Errors » Undefined constants in taxonomy_access_schema()
Issue summary: View changes
pifagor’s picture

pifagor’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: taxonomy_access-2719349-5.patch, failed testing.

pifagor’s picture

Call Work patch

The last submitted patch, 5: taxonomy_access-2719349-5.patch, failed testing.

The last submitted patch, 5: taxonomy_access-2719349-5.patch, failed testing.

pifagor’s picture

Status: Needs work » Needs review
KimNyholm’s picture

When constants from .module are needed, the proper way seems to be using drupal_load() at uninstall. From documentation of hook_schema()

This hook is called at install and uninstall time, and in the latter case, it cannot rely on the .module file being loaded or hooks being known. If the .module file is needed, it may be loaded with drupal_load().

KimNyholm’s picture

Attached a patch with drupal_load() added in hook_schema() in taxonomy_access.install. It would be nicer to move the constants shared with taxonomy_access.module to a seperate file, but given the maturity of the module, this is a smaller change.

An additional test case has been added in taxonomy_access.test checking for correct creation of global defaults.

The patch has been tested with Drupal 7.43.