Account created on 13 July 2022, over 2 years ago
#

Recent comments

the patch doe's not work on my configuration, Drupal 10.1.7, Rabbit Hole 2.0.0@alpha5.

Same issue :

>  [notice] Update started: rabbit_hole_update_8106
>  [error]  Drupal\Component\Plugin\Exception\PluginNotFoundException: The "node_type" plugin does not exist. Valid plugin IDs for Drupal\Core\Condition\ConditionManager are: condition_group, config_pages_values_access, language, request_path, current_theme, user_role, webform, entity_bundle:block_content, entity_bundle:comment, entity_bundle:config_pages, entity_bundle:crop, entity_bundle:feeds_feed, entity_bundle:media, entity_bundle:menu_link_content, entity_bundle:node, entity_bundle:redirect, entity_bundle:shortcut, entity_bundle:taxonomy_term, entity_bundle:webform_submission, entity_bundle:paragraph in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /project/app/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php). 
>  [error]  The "node_type" plugin does not exist. Valid plugin IDs for Drupal\Core\Condition\ConditionManager are: condition_group, config_pages_values_access, language, request_path, current_theme, user_role, webform, entity_bundle:block_content, entity_bundle:comment, entity_bundle:config_pages, entity_bundle:crop, entity_bundle:feeds_feed, entity_bundle:media, entity_bundle:menu_link_content, entity_bundle:node, entity_bundle:redirect, entity_bundle:shortcut, entity_bundle:taxonomy_term, entity_bundle:webform_submission, entity_bundle:paragraph 
>  [error]  Update failed: rabbit_hole_update_8106 
 [error]  Update aborted by: rabbit_hole_update_8106 
 [error]  Finished performing updates.

Indeed, I've already noticed that doing a CEX after an infinite CIM solves the problem, but it's not the expected behavior.
The CEX/CIM should not be impacted by the order of the data, only by the change of the values.

thanks jrockowitz but, i applied another patch : https://www.drupal.org/project/webform/issues/3301970 📌 Fix PHP 8.1 deprecation Closed: duplicate
and that makes yours not appliable.

There may be a misunderstanding.

In core/modules/path_alias/src/PathProcessor/AliasPathProcessor.php

At L54, there is a strpos function, it is a PHP function. This function expects a string in its first parameter.

With PHP8.1 we have to pass a string, and just a string, null is not a string, so you have to secure your code, test the $path variable to be sure it is a string, and nothing other.

So, either test the $path variable before using the strpos function, or cast the $path variable, or do:

strpos($path ?? '', '//')

I think that's not the point!

The goal is to secure the code, with PHP8.1, only the right type must be passed to a function, that the fact, whatever the way a null came to this function, it is necessary to manage, and anticipate this case, to guarantee to only pass a string type to a function that needs a string type in its declaration. :)

Thank you.

after i change the php version to 8.1 from 7.4, clear the cache, go to content page, and bim....

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/web/core/modules/path_alias/src/PathProcessor/AliasPathProcessor.php on line 54

PHP 8.1 change the game, if a function ask for a string, we have to pass a string, and null is not a string.

The best way is to test the $path variable before use it.

cd : https://php.watch/versions/8.1/internal-func-non-nullable-null-deprecation

This is just a proposition, cause i saw this solution many times with this kind of errors with PHP8.1

$path = str_replace($this->decodedChars[0], $this->decodedChars[1], rawurlencode($path ?? ''));

in fact, many lines of this have to be patched for php 8.1 .

all these lines are not compatible with PHP8.1 :

L301 if (strpos($path, '//') === 0) {
L306 $path = str_replace($this->decodedChars[0], $this->decodedChars[1], rawurlencode($path));
L309 if (strpos($path, '/.') !== FALSE) {
L3016 if ('/..' === substr($path, -3)) {

and more...

The best way for me is to test $path before you use it.

Hi,

the first strpos need to be patched too :

if ((strpos($path, '/webform/') === FALSE)
      || is_null($request)
      || is_null($request->getQueryString())
    ) {
      return $path;
    }

with the same solution

if ((strpos($path ?? '', '/webform/') === FALSE)
      || is_null($request)
      || is_null($request->getQueryString())
    ) {
      return $path;
    }
Production build 0.71.5 2024