The current implementation of WebformQuery::setWebform does not return itself, leading to failed calls on any subsequent chained methods.

CommentFileSizeAuthor
#6 webform_query-3081036-6.patch378 bytesmichael_wojcik
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

michael_wojcik created an issue. See original summary.

imclean’s picture

Category: Bug report » Feature request

Presumably you're wanting to query the submissions from multiple specified webforms at once. Currently you can only query one webform or query them all. This could be done, I just wasn't sure how useful it would be considering webforms are usually quite independent of each other.

If this isn't the case, could you provide an example of what you'd like to do?

  • imclean committed 50c4449 on 8.x-1.x
    Issue #3081036 by michael_wojcik, imclean: WebformQuery::setWebform...
imclean’s picture

Category: Feature request » Bug report

Sorry, I misunderstood. This should resolve the issue.

imclean’s picture

Status: Active » Fixed
michael_wojcik’s picture

FileSize
378 bytes

Thanks for following up! I think we'd want to return outside of the IF statement, in case the webform_id is invalid. Here is the patch I made locally.

michael_wojcik’s picture

Status: Fixed » Needs review

If the webform_id is invalid, the method will still lead to an uncaught error, if we don't return $this outside the IF statement.

imclean’s picture

Status: Needs review » Fixed

Makes sense, thanks.

Status: Fixed » Closed (fixed)

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