I'm getting these notices in encrypt configuration page:
Notice: Use of undefined constant REQUIREMENT_OK - assumed 'REQUIREMENT_OK' in encrypt_requirements() (line 88 of ../sites/all/modules/encrypt/encrypt.install).
Notice: Use of undefined constant REQUIREMENT_OK - assumed 'REQUIREMENT_OK' in encrypt_admin_settings() (line 43 of ../sites/all/modules/encrypt/includes/encrypt.admin.inc).
Notice: Use of undefined constant REQUIREMENT_ERROR - assumed 'REQUIREMENT_ERROR' in encrypt_admin_settings() (line 62 of ../sites/all/modules/encrypt/includes/encrypt.admin.inc)
No idea what I did wrong, I am using Aegir and the key was generated and found with no problem. Then I did a migrate to a different platform and these notices showed up.
EDIT:
I would also like to note, that I changed the key path and it created another key fine, but these notices keep showing up.
Comments
Comment #0.0
mengi CreditAttribution: mengi commenteddid a edit of what i tried
Comment #1
Grayside CreditAttribution: Grayside commentedNoticed this in the 6.x version with a quick test tonight. There is some abuse of the concept of hook_requirements() in the module which spawns lots of errors. Form validation and hook_requirements() alerts are not the same thing.
Comment #2
theunraveler CreditAttribution: theunraveler commentedThis should be fixed in 6.x-1.1 ([#1589300]) and 7.x-1.1 ([#1589298]).
I do not consider this an abuse of hook_requirements(). It is not doing form validation per-se; it's checking to see that the module's requirements have been met, which is exactly what hook_requirements() is for.
Regardless, thanks for creating the issue.
Comment #3
Alan D. CreditAttribution: Alan D. commentedWhen using the requirements hook, you will need to also include the install inc directly.
i.e.
To replicate, install a module that uses encrypt().
DO NOT CONFIGURE encrypt()
Trigger the other module to use the encrypt() functions.
Here is the trace:
Comment #4
Alan D. CreditAttribution: Alan D. commentedComment #5
Alan D. CreditAttribution: Alan D. commentedActually, I getting errors even after configuration :(
But the workaround given above fixes these errors :)
BTW, this is not a "hack". See system_status().
Comment #5.0
Alan D. CreditAttribution: Alan D. commentededit2
Comment #6
rlhawkClosing this issue.
Comment #7
Alan D. CreditAttribution: Alan D. commentedNothing seemed to change in the code in the 7.x branches, http://cgit.drupalcode.org/encrypt/tree/encrypt.install, maybe there was an API in Drupal that prevents the issue from occurring?
I've stopped using the module to actually test if it still an issue, but I guess that you did try, triggering a hook_requirements() error or warning at runtime (the status report) and couldn't see the error. So I have changed the status accordingly to can not replicate.
Note on a site with a million modules, another module may be correctly including that file, so the warning is hidden when it gets here ;)