• Priority: 0
  • Status: Waiting on customer
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 07.10.24, 09:58
  • Opened by: marco parascenzo

Ticket #25795 - PopUp Module

Hi,

when I try to configure the popup module from module manager I get this error:

The option “unit” does not exist. Defined options are: “action”, “alert_message”, “alert_position”, “alert_title”, “alert_type”, “allow_extra_fields”, “allow_file_upload”, “attr”, “auto_initialize”, “block_name”, “by_reference”, “column_breaker”, “columns_number”, “compound”, “constraints”, “csrf_field_name”, “csrf_message”, “csrf_protection”, “csrf_token_id”, “csrf_token_manager”, “data”, “data_class”, “default_empty_data”, “disabled”, “empty_data”, “empty_view_data”, “error_bubbling”, “error_mapping”, “external_link”, “extra_fields_message”, “grouping”, “help”, “hint”, “inherit_data”, “invalid_message”, “invalid_message_parameters”, “label”, “label_attr”, “label_format”, “label_help_box”, “label_subtitle”, “label_tag_name”, “mapped”, “method”, “multistore_configuration_key”, “multistore_dropdown”, “post_max_size_message”, “property_path”, “required”, “rounding_mode”, “row_attr”, “scale”, “translation_domain”, “trim”, “upload_max_size_message”, “validation_groups”.

Any ideas?

Thank you

Comments

Fred 07 Oct 2024, 22:28

Hi, marco parascenzo.
Please fill out all necessary fields in your profile https://support.promokit.eu/myprofile to access to your Back-office and FTP Server to let me check that, because there is no such issue on our local and demo server

marco parascenzo 08 Oct 2024, 10:12

Hi,
we are working on a local server not connected to the internet, if the problem occurs in the production version I will provide access.
Thank you.

marco parascenzo 08 Oct 2024, 10:51

Hi,
the problem comes from the file ConfigurationType.php under pkpopup/src/Type see the section below. Prestashop don't recognize the option "unit" for px and sec

→add('width', NumberType::class, [

              'required' => false,
              'label' => $translator->trans('Max popup width', [], 'Modules.Pkpopup.Admin'),
              'unit' => 'px',
              'attr' => [
                  'placeholder' => '800',
              ],
          ])
          ->add('delay', NumberType::class, [
              'required' => false,
              'label' => $translator->trans('Delay before showing the popup', [], 'Modules.Pkpopup.Admin'),
              'unit' => 'sec',
              'attr' => [
                  'placeholder' => '5',
              ],
marco parascenzo 08 Oct 2024, 15:32

Hi,

the problem is only with PS 1.7.8.11 but not with PS 8.2.

I edited the ConfigurationType.php file by adding

use PrestaShopBundle\Form\Admin\Type\TextWithUnitType;

and then I replaced NumberType::class with TextWithUnitType::class and I solved the error.

Fred 08 Oct 2024, 21:39

Hi, Marco.
Sorry for the late reply. And thank you for the solution. We will move it into the module

marco parascenzo 09 Oct 2024, 11:05

Hi,
don't worry, happy to help :)

Fred 09 Oct 2024, 15:41

Thanks