Account created on 28 March 2004, over 20 years ago
#

Recent comments

🇮🇩Indonesia tinohuda

I have drupal 9 webform and files element (private file system), if i access the file its always downloaded, when i use pdf.js its not loaded.

I've add header Content-Disposition: Inline in the nginx conf

# Handle PDFs to display inline
location ~* \.pdf$ {
    add_header Content-Type application/pdf;
    add_header Content-Disposition "inline; filename=\"$uri\"";
    try_files $uri /index.php?$query_string;
}

# Private files handled by Drupal
location /system/files/webform/ {
    internal;
    try_files $uri /index.php?$query_string;
}

# Custom handling for PDFs in private files
location ~* ^/system/files/webform/.+\.pdf$ {
    types { application/pdf pdf; }
    add_header Content-Type application/pdf;
    add_header Content-Disposition "inline; filename=\"$uri\"";
    try_files $uri =404;
}

Unfortunately the pdf still cannot open in the browser, its always downloaded.

I check in the Browser Header content Content-Disposition valeu is attachment.

But when i try to direct access via php it's work.

<?php
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="example.pdf"');
readfile('/system/files/webform/example.pdf');

Anyone can assist me how to make pdf in drupal private files can display in the browser, so I can display via pdf.js.

Thank you for help.

🇮🇩Indonesia tinohuda

same question here, any update?

🇮🇩Indonesia tinohuda

Thank you @AstonVictor

Its work for displaying, but not working for filter/exposed filter in date format.

🇮🇩Indonesia tinohuda

I was installed latest dev version, but can't find "book" string to translate in /admin/config/regional/translate

🇮🇩Indonesia tinohuda

Hi @arne_hortell

is #5 solved?

Anyone can help?

🇮🇩Indonesia tinohuda

Hi @Monster971

Have you solve the problem? can you describe it.

There a thread https://drupal.stackexchange.com/questions/77325/how-to-view-pdf-files-i...

but not solved yet for years.

🇮🇩Indonesia tinohuda

@orizonmedia I use {{ webform_submission.data.field1 }} and its worked. To make sure i use the Devel.

🇮🇩Indonesia tinohuda

#3 [SOLVED]

i've done this by adding % at the end of Query Options JSON File form and create webform element using view type and add token [current-user:account-name] as view arguments.

Thank you.

🇮🇩Indonesia tinohuda

Hi,

I have JSON like this:

[
    {
        "counter": "1",
        "type": "typenode-A",
        "uid": "username2",
        "moderation_state": "Verify"
    },
    {
        "counter": "2",
        "type": "typenode-A",
        "uid": "username2",
        "moderation_state": "Valid"
    }
]

how to implement uid value as contextual filter?

hope anyone can help, thank you before.

🇮🇩Indonesia tinohuda

Hi @jrockowitz thank for your reply.
i'm not a programmer, i try to add this in Webform > Settings > CSS/JS:

jQuery(document).ready(function() {
  // Get the autocomplete element and the textfield element.
  var autocompleteElement = document.getElementById('edit-username-autocomplete');
  var firstNameElement = document.getElementById('edit-field_first_name');

  // When the user selects a username in the autocomplete element,
  // update the first name element with the user's first name.
  autocompleteElement.addEventListener('change', function() {
    var username = autocompleteElement.value;
    var user = Drupal.user.load(username);
    if (user) {
      firstNameElement.value = user.field_first_name;
    }
  });
});

But i got this error in console:
Uncaught TypeError: Cannot read properties of undefined (reading 'load')
at HTMLInputElement.

I hope you can help ;-)

and thank you again.

🇮🇩Indonesia tinohuda

@arne_hortell

Thank you, you saved my day, its work when i add end of URL with / and row apath with [

Thnak you.

🇮🇩Indonesia tinohuda

Hello @antcab

what is your Row Apath value in Query Setting Options?

I try / but nothing show up and i got message "No query was run".

Hope anyone can help.

Thanks before.

🇮🇩Indonesia tinohuda

Some here within drupal 9.5.9,, no pop up when click setting on Views Layout Grid.

🇮🇩Indonesia tinohuda

Hai @tanasi

for me is not working.
does this work for you?

🇮🇩Indonesia tinohuda

Hi @Kris77

Thank for your code above.

I can use {{ content }} and all content can be print out in pdf.

But how to print out particular webform elements label and its values?

I try to use {{ data.field1 }} but nothing printed.

Please help anyone and thank before.

🇮🇩Indonesia tinohuda

@jurgenhaas thank you for your direction and sample.

its so simple, i draw line and now i can add the condition.

very helpful

🇮🇩Indonesia tinohuda

Thank you @longwave you saved my day.

I allow anonymous to access unpublished nodes, now the label showing up in postman and reqbin.

Production build 0.71.5 2024