🇵🇹Portugal @miguelbraga

Account created on 6 April 2018, over 6 years ago
#

Recent comments

🇵🇹Portugal miguelbraga

Dear all,

I'm sorry for reopening this but I'm confused.
(I'm on D7 and latest webform) I'm trying to give set a condition based on a webform grid component value, eg:

Color usage
Never Almost NeveR Sometimes Fairly Often Very Often
Do you use red?
Other color?

With the "other color" question I want to show a textfield if the user selects all options rather than never (to specify color).
It's a basic example but translates what I want to achieve with medical jargon.

Is this possible? the field doesn't appears listed in the first conditional field!

🇵🇹Portugal miguelbraga

Hi Damien,

Thank you for your reply. I'm using php version 7.4. This is recent, it started with the latest update since March (3.29).
I cannot jump to php 8.x still, there are a few modules that will only work under7.x.

Many thanks,
Miguel

🇵🇹Portugal miguelbraga

Im proposing this fix, if it makes any sense, I'm not a developer:

    if (
        isset($data['link']['href'], $router_item['tab_root_href'], $_GET['q']) &&  // Check if the variables are set
        is_array($data['link']['href']) &&                                          // Check if $data['link']['href'] is an array
        is_array($router_item['tab_root_href']) &&                                  // Check if $router_item['tab_root_href'] is an array
        is_array($_GET['q']) &&                                                     // Check if $_GET['q'] is an array
        $data['link']['href'] == $router_item['tab_root_href'] &&                    // Perform the comparison
        $data['link']['href'] != $_GET['q']
    ) {
        $data['link']['localized_options']['attributes']['class'][] = 'active';
    }
🇵🇹Portugal miguelbraga

@RickJ Yes the method of switching the display format to table or grid, and switching it back again seems to be working. I was able to render the values in the PDF. Do you think I should apply the views_pdf-initial_style-3201952-4.patch patch?
Thank you for being considerate and for maintaining this fantastic module.

🇵🇹Portugal miguelbraga

I'm also using webform 7.x-4.25, I try to keep things updated. Haven't migrated to PHP 8.x due to some of the modules behave weirdly.
Follows an export of my view:

$view = new view();
$view->name = 'certificates';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'webform_submissions';
$view->human_name = 'Meeting Certificate';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Certificates';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'role';
$handler->display->display_options['access']['role'] = array(
3 => '3',
2 => '2',
);
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Webform submissions: Serial number */
$handler->display->display_options['fields']['serial']['id'] = 'serial';
$handler->display->display_options['fields']['serial']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['serial']['field'] = 'serial';
$handler->display->display_options['fields']['serial']['exclude'] = TRUE;
/* Field: Webform submission data: Value */
$handler->display->display_options['fields']['value']['id'] = 'value';
$handler->display->display_options['fields']['value']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['value']['field'] = 'value';
$handler->display->display_options['fields']['value']['label'] = '';
$handler->display->display_options['fields']['value']['webform_nid'] = '542';
$handler->display->display_options['fields']['value']['webform_cid'] = '1';
/* Field: Webform submission data: Value */
$handler->display->display_options['fields']['value_1']['id'] = 'value_1';
$handler->display->display_options['fields']['value_1']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['value_1']['field'] = 'value';
$handler->display->display_options['fields']['value_1']['label'] = '';
$handler->display->display_options['fields']['value_1']['webform_nid'] = '542';
$handler->display->display_options['fields']['value_1']['webform_cid'] = '2';
/* Field: Webform submission data: Value */
$handler->display->display_options['fields']['value_2']['id'] = 'value_2';
$handler->display->display_options['fields']['value_2']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['value_2']['field'] = 'value';
$handler->display->display_options['fields']['value_2']['label'] = 'E-mail Address';
$handler->display->display_options['fields']['value_2']['exclude'] = TRUE;
$handler->display->display_options['fields']['value_2']['webform_nid'] = '542';
$handler->display->display_options['fields']['value_2']['webform_cid'] = '3';
/* Contextual filter: Webform submissions: Sid */
$handler->display->display_options['arguments']['sid']['id'] = 'sid';
$handler->display->display_options['arguments']['sid']['table'] = 'webform_submissions';
$handler->display->display_options['arguments']['sid']['field'] = 'sid';
$handler->display->display_options['arguments']['sid']['default_action'] = 'empty';
$handler->display->display_options['arguments']['sid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['sid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['sid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['sid']['summary_options']['items_per_page'] = '25';

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');
$handler->display->display_options['enabled'] = FALSE;

/* Display: PDF Page */
$handler = $view->new_display('pdf', 'PDF Page', 'pdf_1');
$handler->display->display_options['style_plugin'] = 'pdf_unformatted';
$handler->display->display_options['row_plugin'] = 'pdf_fields';
$handler->display->display_options['row_options']['formats'] = array(
'value_2' => array(
'position' => array(
'object' => 'page',
'corner' => 'top_left',
'x' => '19',
'y' => '62',
'width' => '',
'height' => '',
),
'text' => array(
'font_size' => '',
'font_family' => 'default',
'font_style' => NULL,
'align' => NULL,
'hyphenate' => NULL,
'color' => '',
),
'render' => array(
'is_html' => 0,
'custom_layout' => 0,
'minimal_space' => '1',
),
),
);
$handler->display->display_options['row_options']['leading_template'] = '0';
$handler->display->display_options['row_options']['template'] = '0';
$handler->display->display_options['row_options']['succeed_template'] = '0';
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Webform submissions: Serial number */
$handler->display->display_options['fields']['serial']['id'] = 'serial';
$handler->display->display_options['fields']['serial']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['serial']['field'] = 'serial';
$handler->display->display_options['fields']['serial']['exclude'] = TRUE;
/* Field: Webform submission data: Value */
$handler->display->display_options['fields']['value']['id'] = 'value';
$handler->display->display_options['fields']['value']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['value']['field'] = 'value';
$handler->display->display_options['fields']['value']['label'] = '';
$handler->display->display_options['fields']['value']['exclude'] = TRUE;
$handler->display->display_options['fields']['value']['custom_label'] = 'none';
$handler->display->display_options['fields']['value']['webform_nid'] = '542';
$handler->display->display_options['fields']['value']['webform_cid'] = '1';
/* Field: Webform submission data: Value */
$handler->display->display_options['fields']['value_1']['id'] = 'value_1';
$handler->display->display_options['fields']['value_1']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['value_1']['field'] = 'value';
$handler->display->display_options['fields']['value_1']['label'] = '';
$handler->display->display_options['fields']['value_1']['exclude'] = TRUE;
$handler->display->display_options['fields']['value_1']['custom_label'] = 'none';
$handler->display->display_options['fields']['value_1']['webform_nid'] = '542';
$handler->display->display_options['fields']['value_1']['webform_cid'] = '2';
/* Field: Webform submission data: Value */
$handler->display->display_options['fields']['value_2']['id'] = 'value_2';
$handler->display->display_options['fields']['value_2']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['value_2']['field'] = 'value';
$handler->display->display_options['fields']['value_2']['label'] = '';
$handler->display->display_options['fields']['value_2']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['value_2']['alter']['text'] = '[value] [value_1]';
$handler->display->display_options['fields']['value_2']['format'] = 'text';
$handler->display->display_options['fields']['value_2']['custom_label'] = 'none';
$handler->display->display_options['fields']['value_2']['webform_nid'] = '542';
$handler->display->display_options['fields']['value_2']['webform_cid'] = '3';
$handler->display->display_options['path'] = 'viewspdf/%/webform.pdf';
$handler->display->display_options['displays'] = array(
'default' => 'default',
'page_1' => 'page_1',
'block' => 0,
);
$handler->display->display_options['default_page_orientation'] = 'L';
$handler->display->display_options['leading_template'] = '0';
$handler->display->display_options['template'] = 'palma-attendance-template.pdf';
$handler->display->display_options['succeed_template'] = '0';
$handler->display->display_options['default_font_family'] = 'latobi';
$handler->display->display_options['default_font_style'] = array(
'b' => 'b',
'i' => 0,
'u' => 0,
'd' => 0,
'o' => 0,
);
$handler->display->display_options['default_font_size'] = '28';

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Webform submissions: Serial number */
$handler->display->display_options['fields']['serial']['id'] = 'serial';
$handler->display->display_options['fields']['serial']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['serial']['field'] = 'serial';
$handler->display->display_options['fields']['serial']['exclude'] = TRUE;
/* Field: Webform submission data: Value */
$handler->display->display_options['fields']['value']['id'] = 'value';
$handler->display->display_options['fields']['value']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['value']['field'] = 'value';
$handler->display->display_options['fields']['value']['label'] = '';
$handler->display->display_options['fields']['value']['custom_label'] = 'none';
$handler->display->display_options['fields']['value']['webform_nid'] = '542';
$handler->display->display_options['fields']['value']['webform_cid'] = '1';
/* Field: Webform submission data: Value */
$handler->display->display_options['fields']['value_1']['id'] = 'value_1';
$handler->display->display_options['fields']['value_1']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['value_1']['field'] = 'value';
$handler->display->display_options['fields']['value_1']['label'] = '';
$handler->display->display_options['fields']['value_1']['custom_label'] = 'none';
$handler->display->display_options['fields']['value_1']['webform_nid'] = '542';
$handler->display->display_options['fields']['value_1']['webform_cid'] = '2';
/* Field: Webform submission data: Value */
$handler->display->display_options['fields']['value_2']['id'] = 'value_2';
$handler->display->display_options['fields']['value_2']['table'] = 'webform_submissions';
$handler->display->display_options['fields']['value_2']['field'] = 'value';
$handler->display->display_options['fields']['value_2']['label'] = '';
$handler->display->display_options['fields']['value_2']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['value_2']['alter']['text'] = '[value] [value_1] [value_2]';
$handler->display->display_options['fields']['value_2']['format'] = 'text';
$handler->display->display_options['fields']['value_2']['custom_label'] = 'none';
$handler->display->display_options['fields']['value_2']['webform_nid'] = '542';
$handler->display->display_options['fields']['value_2']['webform_cid'] = '3';
$handler->display->display_options['path'] = 'viewspdf/%/webform.pdf';

🇵🇹Portugal miguelbraga

It isn't, just updated TCPDF to 6.3.5 and still no luck...

🇵🇹Portugal miguelbraga

Yes a get the value! That's why it's really strange...
My version of TCPDF is 6.2.22, could this be the culprit?
I'm still on PHP 7.4 (due to hosting) but plan to upgrade ASAP.

🇵🇹Portugal miguelbraga

@RickJ Just tried your method, fiddled with the existing view but the result is the same. Then I created a new view, same method as yours, but again nothing gets printed. Reverted back to 7.x.1.x and everything works, old and new view...

While on 3.x this came up:

Warning: chr() expects parameter 1 to be int, string given in TCPDF_FONTS::unichr() (line 1671 of /home/.../public_html/sites/all/libraries/tcpdf/include/tcpdf_fonts.php).

Deprecated function: Array and string offset access syntax with curly braces is deprecated in require_once() (line 16 of /home/.../public_html/sites/all/modules/views_pdf/views_pdf_template.php).

🇵🇹Portugal miguelbraga

Dear Liam,

Going back to this topic, I'm not sure how to edit the webform-submission.tpl.
I've done a new webform-submission-573.tpl for the target form but if I change print drupal_render_children($renderable); to any other tag like print render($form['submitted']['first_name']); it doesn't works. What the logic behind this file? print drupal_render_children($renderable)['submitted']['first_name']); ?

Production build 0.71.5 2024