glennnz β created an issue.
glennnz β created an issue.
glennnz β created an issue.
#9 works with a small typo correction, add quotes, thus:
<a href=β/node/3β data-dialog-type=βmodalβ class=βuse-ajaxβ data-dialog-option="{"width":800, "height":500}">Node 3</a>
@viren18febS
Like this?
<a class="use-ajax" data-dialog-type="modal-xl" href="..........
This doesn't work, the link doesn't open, no modal window appears.
Thanks,
Glenn
glennnz β created an issue.
@jrockowitz
I have the twig template working but can't get the webform submission data to show in the email.
I've used your code from comment #7, but can't get the data to display in the email; {{ data }} or {{data.field_name }} both show as empty in the rendered email.
Thanks.
Solved for me.
Selected Twig template as the email handler body format, and named my twig file as webform-email-message-html--WEBFORM-ID.html.twig.
I get this error:
Parameter "node" for route "entity.node.canonical" must match "\d+" ("" given) to generate a corresponding URL.
glennnz β created an issue.
glennnz β created an issue.
Which preprocess function would I use, and where would I use it, if my twig is theming an email sent by:
- A webform email handler, or
- A QueueWorker
Thanks
@apotek, did you get this working? I can't get it to work either....
glennnz β created an issue.
Code that works:
$backend_proxy=\Drupal::service('fillpdf.backend_proxy');
$fillpdf_form = FillPdfForm::load($fid);
$populated_pdf = $backend_proxy->merge($fillpdf_form, $entities);
$filename = ('custom-filename.pdf');
$destination = 'private://' . $filename;
$file_entity = \Drupal::service('file.repository')->writeData($populated_pdf, $destination, FileSystemInterface::EXISTS_REPLACE);
glennnz β created an issue.
@jrockowitz
Re your comment #7, how could I make those submission data items available for use in a node that wanted to display some webform data?
Thanks.
When I use fillpdf.populate_pdf
I get an error.
My code within my Controller's method is:
<?php
namespace Drupal\example_module\Controller;
use Drupal\Core\Controller\ControllerBase;
use \Drupal\Core\Url;
use Drupal\node\Entity\Node;
use Drupal\webform\Entity\WebformSubmission;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Drupal\fillpdf\Component\Utility\FillPdf;
use Drupal\file\Entity\File;
use Drupal\fillpdf\Entity\FillPdfForm;
use Drupal\fillpdf\TokenResolver;
class TestController extends ControllerBase {
public function testfillpdf() {
<-- a bunch of stuff to get the webform data-->
$fillpdf_route = Url::fromRoute('fillpdf.populate_pdf', [], [
'query' => [
'fid' => $template,
'entity_id'=>"webform_submission:{$sid}",
'download'=>0,
'flatten'=>1,
],
]);
$this->drupalGet($fillpdf_route);
}
}
I get error, "You have requested a non-existent service "fillpdf.populate_pdf"". I can't see what I'm doing different to public function testPdfPopulation()
in PdfWebformPopulationTest.php.
Thanks
Liam,
I'm trying:
// Create the documents with FillPDF
$query = [
'fid' => $fid,
'entity_type' => 'webform_submission',
'entity_id' => $sid,
'download' => '0',
'flatten' => '1',
];
$url = Url::fromRoute('fillpdf.populate_pdf', [], ['query' => $query]);
$context = $this->linkManipulator->parseLink($url);
This is returning Call to a member function parseLink() on null, where am I going wrong here?
Thanks.
Liam, is this the link_manipulator service?
Just found this error:
Failed to start the session because headers have already been sent by "/container/application/public/vendor/symfony/http-foundation/Response.php" at line 384.
This indicates that my RedirectResponse will never work to create more than one.
Help please!
Thanks
I'm making some progress here, just by using a RedirectResponse, but I suspect there's a better way to do it...
Now I'm trying to loop through several forms and create several PDF files, all with data from the same webform submission.
My code is:
// Create the documents with FillPDF
$fillpdf_urls = array(
('https://example.com/fillpdf?fid=' . $fid_1 . '&entity_type=webform_submission&entity_id=' . $sid . '&download=0&flatten=1'),
('https://example.com/fillpdf?fid=' . $fid_2 . '&entity_type=webform_submission&entity_id=' . $sid . '&download=0&flatten=1'),
('https://example.com/fillpdf?fid=' . $fid_3 . '&entity_type=webform_submission&entity_id=' . $sid . '&download=0&flatten=1')
);
foreach($fillpdf_urls as $fillpdf_url) {
$response = new RedirectResponse($fillpdf_url);
$request = \Drupal::request();
// Save the session so things like messages get saved.
$request->getSession()->save();
$response->prepare($request);
// Make sure to trigger kernel events.
\Drupal::service('kernel')->terminate($request, $response);
$response->send();
}
This only creates the first one; I think because a redirection is occuring at the first $response->send().
How can I get this loop to work?
Thanks
I've changed my UX for now, requiring the PDF template files to be uploaded first, then referencing them in my original_node.
Now I can, within my QueueWorker, create the url for the filled PDF; this is working fine.
Now I need to attach that filled PDF to the new_node; how do I do that? So far as I can see, unless I have a browser point to that URL, the filled PDF won't be created. I need to create it from my QueueWorker during a cron run, and attach it it new_node.
Thanks.
glennnz β created an issue.
Understood; thanks for your work on this great module when you have time!
I've rolled back to D9 in the meantime.
Thanks
Thanks @liam-morland.
That's resolved quite a few of the errors, but some remain.
What is the timeframe for this method to resolve all the D10 compatability errors? I'm windering if I'm better to roll back to D9 on the entire site.
Thanks,
Glenn
I'm struggling with this too; trying to override the default 'webform submitted' email with a twig template. I've selected Twig as the email format and have added just, "This is broken..." to that field.
If my webform name is 'custom_webform' and I've added an email handler to that webform called 'custom_handler', exactly what should my twig file be called?
And, do I need to define this in a hook_theme()? I don't think so.
I'm getting lots of emails telling me that it's broken....
Thanks,
Glenn
How can I do this in D10?
glennnz β created an issue.
@Liam. Yes, tried that to no avail, it definitely seems to be something with ddev.
It's working on my live server so I'll test there.
Thanks
Same error for me.
Running D10 on a local ddev server.
in Terminal:
locale gives me "en_NZ.UTF-8"
which pdftk gives me "/usr/local/bin/pdftk"
Using those two options on my config page for fillpdf gives me, "The path you have entered for pdftk is invalid. Please enter a valid path. "
Works perfectly!
Thanks.
Yes:
BackgroundUpdate: _reasonsToNotScheduleUpdates: Failed to check for Maintenance Service Registry Key: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIUpdateProcessor.getServiceRegKeyExists]" nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame :: resource://gre/modules/BackgroundUpdate.sys.mjs :: _reasonsToNotScheduleUpdates :: line 247" data: no] BackgroundUpdate.sys.mjs:249
AbortError: Actor 'Conduits' destroyed before query 'RuntimeMessage' was resolved 4 ConduitsParent.jsm:375
_raceResponses resource://gre/modules/ConduitsParent.jsm:375
Missing resource in locale en-GB: devtools/client/toolbox.ftl
Some cookies are misusing the recommended βSameSiteβ attribute 3
glennnz β created an issue.
Ah, ran into problems.....
In my webform definition.yml file, I have:
stripe_payment:
'#type': stripe_payment
'#title': Payment
'#stripe_source': custom
'#stripe_amount' : ['custom:price']
'#stripe_currency' : nzd
'#stripe_product': prod_NsAdetyTMZWPCL
'#stripe_address': true
'#stripe_address_type': billing
'#stripe_customer_attributes': ''
'#stripe_appearance': ''
'#stripe_payment_intent_config': |-
automatic_payment_methods:
enabled: true
In my mymodule.module, I have:
function mymodule_token_info() {
$tokens['price'] = [
'name' => t('Final Price'),
'description' => t('The price of the product.'),
];
return [
'types' => ['custom' => $type],
'tokens' => ['custom' => $tokens],
];
}
function mymodule_tokens($type, $tokens, array $data, array $options, \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata) {
$replacements = [];
if ($type == 'custom') {
foreach ($tokens as $name => $original) {
switch ($name) {
case 'price':
$replacements[$original] = '123999123';
break;
}
}
}
return $replacements;
}
The '123999123' is a placeholder for the moment; this will become a calculated value.
My code is creating an error in the createPaymentIntent(), I get this error:
TypeError: Unsupported operand types: array * int in Drupal\stripe_webform_payment\Plugin\WebformElement\StripeWebformPayment->createPaymentIntent() (line 351 of modules/contrib/stripe_webform_payment/src/Plugin/WebformElement/StripeWebformPayment.php).
Help would be appreciated.
Thanks.
Perhaps edit the instructions for the 'Amount' field; it asks for a float and doesn't indicate that a token can be used.
Solved.
I built a module to create a custom token with my calculated price; this works beautifully.
@hodba
No, this doesn't work. The field in the webform element settings asks for a float number; putting a token there results in an error:
TypeError: Unsupported operand types: string * int in Drupal\stripe_webform_payment\Plugin\WebformElement\StripeWebformPayment->createPaymentIntent() (line 351 of modules/contrib/stripe_webform_payment/src/Plugin/WebformElement/StripeWebformPayment.php).
glennnz β created an issue.
glennnz β created an issue.
glennnz β created an issue.
glennnz β created an issue.
glennnz β created an issue.
I found the setting in the Checkout Flow settings, but no matter the selection (On session or Off session), the previously used CC details keep reappearing.
Glenn
Stripe allows me to disable the saving of credit card details via their API, and I can see the function 'setup_future_usage' all over the place in the code.
How do I get to this option? I can't find it.....
I got it to work with:
public function buildPaneSummary() {
if ($field_a = $this->order->getData('field_a')) {
$return['field_a'] = [
'#prefix' => ('<p>'),
'#plain_text' => $this->order->getData('field_a'),
'#suffix' => ('</p>'),
];
}
if ($field_b = $this->order->getData('field_b')) {
$return['field_b'] = [
'#plain_text' => $field_b,
'#suffix' => ('</p>'),
];
}
return [$return];
}
But I'm quietly confident that there's a smarter way to do it.....
glennnz β created an issue. See original summary β .
I'm getting:
The website encountered an unexpected error. Please try again later.
Error: Class "\Mailchimp\Mailchimp" not found in Drupal\mailchimp\ClientFactory->createInstance() (line 154 of modules/contrib/mailchimp/src/ClientFactory.php).
While trying a fresh install on 9.5.7, using Composer
glennnz β created an issue.
glennnz β created an issue.
Hi,
Opening this again as Commerce has progressed from the original post.
I'm using Commerce 2 (v8.x) and have the same request.
How can I sell a filled PDF file?
I'm happy to code it , I'm keen to understand at what point the filled pdf is created; after purchase completion, or before, and then 'access' to the filled pdf is sold to the buyer.
NgΔ mihi,
Glenn
@RGonski, copied and pasted from the codebase using https://mysite.com/admin/config/development/configuration/single/import
On D9.5.3
glennnz β created an issue.