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.
- Create webform handler
- Add data to a queue
- Add queueworker for processing the queue
- Push data to webform in queue
Comments
Comment #2
Safallia Joseph CreditAttribution: Safallia Joseph at Acro Commerce commentedThe attached patch Creates a webform handler and sends the data to pardot in queue processor. Please review
Comment #3
Safallia Joseph CreditAttribution: Safallia Joseph at Acro Commerce commentedComment #4
Safallia Joseph CreditAttribution: Safallia Joseph at Acro Commerce commentedThe attached patch removes the third party settings and instead set the URL in webform handler general settings.
Comment #5
Safallia Joseph CreditAttribution: Safallia Joseph at Acro Commerce commentedPlease review
Comment #6
travis-bradbury CreditAttribution: travis-bradbury at Acro Commerce commentedI'm skeptical that that should be the public API for the service. I wouldn't know how to use that. What URL? What kind of data?
The implementation of this method, and PardotSubmissionQueue::processItem, indicates it should return something, but that's not described on the interface.
What it is returning is the response from Pardot, but that seems like it should remain the pardot handler service's problem, and the return value should be whatever the queue worker needs to know to decide how to manage the job (ie so the queue worker can tell if it is it done, if it it succeeded or failed, should it retry?).
It looks like $pardot_submission has not been defined anywhere.
I'm not a fan of the queue having a copy of all that data, and not knowing about changes to it. What is a submission is edited or someone configured the wrong URL and had to fix it? I'd just put the ID of the submission in the queue and let the pardot service figure out the rest of this.
If PardotHandlerInterface took a webform submission as its argument instead of the destination and data, it would actually be doing something more than wrapping @http_client. Alternative implementations of the pardot handler service would have more freedom.
+ "homepage": "https://www.drupal.org/project/commerce_bluesnap",
Looks like that should be https://www.drupal.org/project/webform_pardot.
Most of that description is noise - don't bother saying it's a class, has functions, or is helpful. Removing those parts, the description doesn't say what the class is for. What about something like "Sends (data? form data?) to a Pardot form handler." Also see https://www.drupal.org/docs/develop/standards/api-documentation-and-comm....
PardotHandlerInterface is better (though I'm not sure you need to say it's an interface since that's in the name already. I suggest checking what Drupal core or Commerce write for their interfaces and using them as a guide.). It includes a third person verb in "Provides". Is that the right verb? It actually sends data, but prepares implies it just gets something ready.
That's in PardotHandler so the description is not correct.
Simiarly, PardotSubmission::__construct() says it constructs a WebformHandlerBase object. I'm not sure if that one should just use {@inheritdoc} or if it should have its own documentation.
Don't bother calling it a module. Pardot is a proper noun so it should be capitalized.
For .module file @file comments, describe the feature the module provides, not what module it's for (that's already known from the directory and file name). See https://www.drupal.org/docs/develop/standards/api-documentation-and-comm....
Have you planned for how to write tests for this process yet?
Comment #7
travis-bradbury CreditAttribution: travis-bradbury at Acro Commerce commentedOr, since #3090582: Log all activities associated with pardot submission creates an entity for Pardot submissions, the ID of the Pardot submission entity, not the Webform submission entity.
Comment #8
travis-bradbury CreditAttribution: travis-bradbury at Acro Commerce commentedComment #9
Safallia Joseph CreditAttribution: Safallia Joseph at Acro Commerce commentedThanks for the review Travis, The attached patch addresses the issues, I have corrected the documentation and used webform submission ID instead of passing everything to queue.
I have kept it as public API for now, I shall modify it in issue #3090582: Log all activities associated with pardot submission if needed
I plan to write unit tests, which will be done as part of task #3090587.
I shall make that change as part of #3090582: Log all activities associated with pardot submission
Comment #10
Safallia Joseph CreditAttribution: Safallia Joseph at Acro Commerce commentedComment #11
Safallia Joseph CreditAttribution: Safallia Joseph at Acro Commerce commentedInterdiff between patches in #9 and #4
Comment #12
travis-bradbury CreditAttribution: travis-bradbury at Acro Commerce commentedLooks good to me, Safallia. The interface is a lot cleaner now that it's getting the submission.
Comment #14
Safallia Joseph CreditAttribution: Safallia Joseph at Acro Commerce commentedTanks Travis, Committed the patch.
Comment #15
Safallia Joseph CreditAttribution: Safallia Joseph at Acro Commerce commented