Sylius: Help parameter not displayed behind form field

Created on 24 Jun 2019  路  3Comments  路  Source: Sylius/Sylius

Sylius version affected: 1.4 at least

Description
Symfony 4.1 feature described here https://symfony.com/blog/new-in-symfony-4-1-form-field-help not working at Sylius with even Symfony 4.3

# src/Form/Type/SomeFormType.php

    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        // ...
            ->add('payment_methods', TextType::class, [
                'help' => 'https://learn.quickpay.net/tech-talk/appendixes/payment-methods/#payment-methods',
            ])
    }

Renders form without help:

<div class="required field"><label for="sylius_payment_method_gatewayConfig_config_payment_methods" class="required">Payment methods</label><input type="text" id="sylius_payment_method_gatewayConfig_config_payment_methods" name="sylius_payment_method[gatewayConfig][config][payment_methods]" required="required" value="creditcard, paypal, !viabill"></div>

Screenshot: https://www.dropbox.com/s/wdpv4g6atpe62n5/Screenshot%202019-06-24%2019.19.05.png?dl=0

Steps to reproduce

  • Provide help parameter to any form field.
  • Refresh front-end and see that content of help parameter not displayed below form field

Possible Solution
Not sure, maybe fix form template

Potential Bug

All 3 comments

https://jsfiddle.net/vvasiloi/aLc6etzk/

Basically the help widget for any input consists of the following markup:

<i class="question circle outline link icon" data-help-popup="help-popup"></i>
<div class="ui popup" id="help-popup">
   Find more at <a href="https://docs.sylius.com/">Sylius Docs</a>
</div>

and the initialization script:

$('[data-help-popup]').each(function() {
  const $trigger = $(this);
  $trigger.popup({
    inline: true,
    preserve: true,
    hoverable: true,
    popup: $trigger.attr('data-help-popup')
  });
});

WDYT?

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

I got the same issue, so i'll fix it ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xleliberty picture xleliberty  路  3Comments

hmonglee picture hmonglee  路  3Comments

foxou33 picture foxou33  路  3Comments

crbelaus picture crbelaus  路  3Comments

reyostallenberg picture reyostallenberg  路  3Comments