Getting this error on Webform on my D10 site while viewing webform submissions: (e.g. /admin/structure/webform/manage/**webform_machine_name**/results/submissions)

Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\webform\WebformSubmissionListBuilder->getEntityIds() (line 1310 of modules/contrib/webform/src/WebformSubmissionListBuilder.php).

This appears to happen because TableSort::getOrder($header, $this->request) can return $order['sql'] null, and the subsequent strpos can't handle the null value.

CommentFileSizeAuthor
#2 3383921-deprecated-strpos-2.patch750 bytestrevorbradley

Issue fork webform-3383921

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

TrevorBradley created an issue. See original summary.

trevorbradley’s picture

StatusFileSize
new750 bytes

Quick and simple patch to properly check for null values.

trevorbradley’s picture

Issue summary: View changes
trevorbradley’s picture

Issue summary: View changes
trevorbradley’s picture

Issue summary: View changes

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

cilefen’s picture

I think the idea is to fix all of these in #3381257: [Drupal 10.1] Deprecated code rather than in separate issues.

jrockowitz’s picture

This is not precisely a D10 issue. I think it is a PHP 8.1 notice.

cilefen’s picture

Of course it's PHP. I evidently didn't understand the true goal of #3381257: [Drupal 10.1] Deprecated code.

jrockowitz’s picture

LOL, the goal is to stop people solely looking for commit credit from creating dozens of deprecated code fix tickets.

trevorbradley’s picture

I don't care about commit credit at all. Just desperately needed this fixed for my site.

Close this ticket as a duplicate and steal the code for the main ticket, genuinely dont mind at all.

jrockowitz’s picture

jrockowitz’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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