Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Whenever you clear cache, you get this error:
Notice: Use of undefined constant DRUPAL_NO_CACHE - assumed 'DRUPAL_NO_CACHE' in Drupal\cleverreach\Plugin\Derivative\CleverreachBlock->getDerivativeDefinitions() (line 50 of modules\contrib\cleverreach\src\Plugin\Derivative\CleverreachBlock.php).
There are some articles on the net that show to use it for D8, but there is no more DRUPAL_NO_CACHE constant in D8 in common.inc.
So this line of code does not do anything, except cause an error.
As a quickfix, I commented it out locally.
If we do not want to cache this block, then another solution will be needed, probably where we generate the render-arrays.
Comment | File | Size | Author |
---|---|---|---|
#3 | use_of_undefined_constant-2856345.patch | 1.38 KB | snufkin |
#2 | use_of_undefined_constant-2856345-2.patch | 1.39 KB | Znak |
Comments
Comment #2
Znak CreditAttribution: Znak commentedComment #3
snufkin CreditAttribution: snufkin as a volunteer and at Cheppers commentedI would +1 on that. Looking at Mailchimp they seem to solve it similarly at #2585239: Use of undefined constant DRUPAL_NO_CACHE, code at http://cgit.drupalcode.org/mailchimp/tree/modules/mailchimp_signup/src/P....
I've updated the patch to remove the commented out code piece as well, but the main commit credit is due to Znak for pointing out the issue and rolling a patch.
Comment #4
AnybodyPatch works well and fixes the problem. RTBC.
Comment #5
rgpublicIs there still a maintainer of this module who could commit this?