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.
PHP 7.2 deprecated string as arguments to assert()
. Core removed usage in issue #2853503: Remove all assert('string') calls from Drupal core because deprecated in PHP 7.2 for 8.5.x so that's probably the correct solution.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2944186-1-remove-string-assert.patch | 898 bytes | neclimdul |
Comments
Comment #2
neclimdulQuick patch converting string argument and replacing it with a direct call.
Comment #3
ChrisSnyderThis patch worked for me on PHP 7.2
Comment #4
pick_d CreditAttribution: pick_d commentedThanks for the patch.
When switching my Drupal 8.5.3 website to PHP 7.2 I'll get broken website (but still with working drush / composer via ssh though) and plenty of errors.
I'm going to cite an example in case anyone will try to google it:
Error: Class 'Redis' not found в Drupal\redis\Client\PhpRedis->getClient() (строка 18 из /home/b/myusername/mydomain/public_html/modules/redis/src/Client/PhpRedis.php) #0 /home/b/myusername/mydomain/public_html/modules/redis/src/ClientFactory.php(175): Drupal\redis\Client\PhpRedis->getClient('127.0.0.1', 6379, NULL, NULL) #1 /home/b/myusername/mydomain/public_html/modules/redis/src/Cache/CacheBackendFactory.php(65): Drupal\redis\ClientFactory::getClient() #2 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Core/Cache/CacheFactory.php(83): Drupal\redis\Cache\CacheBackendFactory->get('page') #3 [internal function]: Drupal\Core\Cache\CacheFactory->get('page') #4 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(248): call_user_func_array(Array, Array) #5 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'cache.page') #6 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(480): Drupal\Component\DependencyInjection\Container->get('cache.page', 1) #7 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(230): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) #8 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware...') #9 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(480): Drupal\Component\DependencyInjection\Container->get('http_middleware...', 1) #10 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(230): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) #11 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware...') #12 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(480): Drupal\Component\DependencyInjection\Container->get('http_middleware...', 1) #13 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(230): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) #14 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware...') #15 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(480): Drupal\Component\DependencyInjection\Container->get('http_middleware...', 1) #16 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(230): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) #17 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'http_kernel') #18 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Core/DrupalKernel.php(1380): Drupal\Component\DependencyInjection\Container->get('http_kernel') #19 /home/b/myusername/mydomain/public_html/core/lib/Drupal/Core/DrupalKernel.php(664): Drupal\Core\DrupalKernel->getHttpKernel() #20 /home/b/myusername/mydomain/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #21 {main}.
The patch worked for me on PHP 7.2.5 (8.x-1.0-rc2), now i'm able to upgrade.
Comment #6
BerdirThat error means the redis extension wasn't enabled, it has nothing to do with the change that was done here.
Committed the patch, thanks.