Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The current implementation of WebformQuery::setWebform does not return itself, leading to failed calls on any subsequent chained methods.
Comment | File | Size | Author |
---|---|---|---|
#6 | webform_query-3081036-6.patch | 378 bytes | michael_wojcik |
Comments
Comment #2
imclean CreditAttribution: imclean commentedPresumably 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?
Comment #4
imclean CreditAttribution: imclean commentedSorry, I misunderstood. This should resolve the issue.
Comment #5
imclean CreditAttribution: imclean commentedComment #6
michael_wojcik CreditAttribution: michael_wojcik at Hook 42 for Autodesk Knowledge Network commentedThanks 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.
Comment #7
michael_wojcik CreditAttribution: michael_wojcik at Hook 42 for Autodesk Knowledge Network commentedIf the webform_id is invalid, the method will still lead to an uncaught error, if we don't return $this outside the IF statement.
Comment #9
imclean CreditAttribution: imclean commentedMakes sense, thanks.