On updating to PHP 8.1, I get the following report.

Deprecated function: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in template_preprocess_footable_view() (line 206 of /home/ipmsusa3/public_html/drupal7/sites/all/modules/contrib/footable/footable.module).

This look similar to https://www.drupal.org/project/lagoon_logs/issues/3334327 and applying that type of fix to

    elseif (drupal_strlen($field_handler->last_render) != drupal_strlen(strip_tags($field_handler->last_render))) {

to this

    elseif (drupal_strlen($field_handler->last_render) != drupal_strlen(strip_tags($field_handler->last_render ?? ''))) {

seems to work.

Issue fork footable-3343723

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

aitala created an issue. See original summary.

adil_siddiqui’s picture

Status: Active » Needs review
StatusFileSize
new660 bytes

Patch created

avpaderno’s picture

Title: PHP 8.1 issue » strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in template_preprocess_footable_view()
Version: 7.x-2.0 » 7.x-2.x-dev
Issue summary: View changes
Issue tags: +PHP 8.1
avpaderno’s picture

Status: Needs review » Needs work
-    elseif (drupal_strlen($field_handler->last_render) != drupal_strlen(strip_tags($field_handler->last_render))) {
+    elseif (drupal_strlen($field_handler->last_render) != drupal_strlen(strip_tags((string) $field_handler->last_render ?? ''))) {

If $field_handler->last_render is not a string, it is pointless to execute that code, as zero (drupal_strlen($field_handler->last_render)) is equal to zero (drupal_strlen(strip_tags((string) $field_handler->last_render ?? '')).

shivam_tiwari made their first commit to this issue’s fork.

sahil.goyal’s picture

Status: Needs work » Needs review
StatusFileSize
new687 bytes
new616 bytes

Addressed the comment #4, So to address this issue modified the code to check if $field_handler->last_render is a string before executing the drupal_strlen and strip_tags functions.
Before attempting to check here its length and strip out any tags, If $field_handler->last_render is not a string, the code inside the if statement will not be executed.

So updating the patch and attaching Interdiff.