When uninstalling the module, if facetapi is already disabled:

Notice: Use of undefined constant FACETAPI_DATE_YEAR - assumed 'FACETAPI_DATE_YEAR' in search_api_facetapi_uninstall()
Notice: Use of undefined constant FACETAPI_DATE_MONTH - assumed 'FACETAPI_DATE_MONTH' in search_api_facetapi_uninstall()
Notice: Use of undefined constant FACETAPI_DATE_DAY - assumed 'FACETAPI_DATE_DAY' in search_api_facetapi_uninstall()
[...]

The constants are defined in facetapi.module. If facetapi is already disabled then uninstalling will fail to delete the variables.
Maybe use the literal string values? I don't have a better idea atm.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

donquixote created an issue. See original summary.

drunken monkey’s picture

Component: General code » Facets
Status: Active » Needs review
FileSize
1.34 KB

Thanks a lot for reporting!
You're right, of course, we can't use the constants at this point anymore. The usual troubles of module uninstallation …
Using the literal values instead seems indeed to be the best solution I can think of – only other one would be to manually include the facetapi.module (if necessary), and I'm pretty sure that's out of the question.

Patch attached, please test/review!

  • drunken monkey committed 2dea835 on 7.x-1.x
    Issue #2833482 by drunken monkey: Fixed undefined constant when...
drunken monkey’s picture

Status: Needs review » Fixed

Would have been nice to have a review, but should be fine in any case.
Committed.
Thanks again for reporting!

donquixote’s picture

Oh, sorry.
But yes it looks fine. I don't see what could possibly go wrong.

Status: Fixed » Closed (fixed)

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