Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Reduce the severity of the Memcache version mismatch message from "error" to "warning"
Reduce the severity of the Memcache version mismatch message from "error" to "warning"
Comments
Comment #1
totosarg CreditAttribution: totosarg commentedPatch for reducing the severity of memcache version mismatch is attached.
Comment #2
totosarg CreditAttribution: totosarg commentedComment #3
Jeremy CreditAttribution: Jeremy commentedThis affects too many valid errors. We should only make an out-dated 'memcache PECL extension' a warning instead of an error, because currently there's no "stable" recommended release.
The following should still be considered errors, not warnings:
$errors[] = $t('Required PHP extension not found. Install the <a href="http://php.net/manual/en/book.memcache.php">memcache</a> (recommended) or <a href="http://php.net/manual/en/book.memcached.php">memcached</a> extension.');
$errors[] = $t('Failed to load required file %dmemcache.', array('%dmemcache' => drupal_get_path('module', 'memcache') . '/' . 'dmemcache.inc'));
$errors[] = $t('Failed to connect to memcached server instance at %server.', array('%server' => $server));
$errors[] = $t('Failed to store to then retrieve data from memcache.');
$errors[] = $t('Unexpected failure when testing memcache configuration.');
It's the following error we can turn into a warning, but only in the case of the 'memcache' PECL extension, not in the case of the 'memcached' PECL extension:
$errors[] = $t('PECL !extension version %version is unsupported. Please update to %recommended or newer.', array(
Comment #4
Jeremy CreditAttribution: Jeremy commentedActually, we can make all version checks a warning -- no need to differentiate between PECL memcache and memcached.
Comment #5
totosarg CreditAttribution: totosarg commentedDone. Also, the code in the patch allows you to populate warnings down the road fairly easily.
Comment #6
totosarg CreditAttribution: totosarg commentedLast iteration, per your comment, removed duplicate error message code.
Comment #7
totosarg CreditAttribution: totosarg commentedfurther reduced message duplication.
Comment #8
totosarg CreditAttribution: totosarg commentedComment #9
Jeremy CreditAttribution: Jeremy commentedThis is getting closer. I've done a little cleanup to follow Drupal.org coding standards ( https://drupal.org/coding-standards ) and made sure all text is translatable. Attaching an updated patch.
However, you've got an order of presidence issue -- if there's a warning it must be displayed, whereas we don't see errors if there's a warning. I killed memcache and had an outdated PECL, and all I get is a warning that PECL is outdated, no error that memcache isn't running.
Comment #10
totosarg CreditAttribution: totosarg commentedJeremy, i made the changes per our discussion. Attached in the patch.
Comment #11
Jeremy CreditAttribution: Jeremy commentedThanks! Committed:
http://cgit.drupalcode.org/memcache/commit/?id=c7c0120
Comment #12
totosarg CreditAttribution: totosarg commentedThanks Jeremy! It was a pleasure to meet you, and i appreciate all the feedback :)