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.

CommentFileSizeAuthor
#2 2944186-1-remove-string-assert.patch898 bytesneclimdul
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

neclimdul created an issue. See original summary.

neclimdul’s picture

Status: Active » Needs review
FileSize
898 bytes

Quick patch converting string argument and replacing it with a direct call.

ChrisSnyder’s picture

Status: Needs review » Reviewed & tested by the community

This patch worked for me on PHP 7.2

pick_d’s picture

Thanks 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.

  • Berdir committed 68b1e1c on 8.x-1.x authored by neclimdul
    Issue #2944186 by neclimdul: Deprecation warning in PHP 7.2
    
Berdir’s picture

Status: Reviewed & tested by the community » Fixed

That error means the redis extension wasn't enabled, it has nothing to do with the change that was done here.

Committed the patch, thanks.

Status: Fixed » Closed (fixed)

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