- Issue created by @axle_foley00
- 🇯🇲Jamaica axle_foley00
I dug into this a little more and found the issue in the src/Form/EptCoreSettingsForm.php file.
// Define the array with breakpoints values. $breakpoint_values = [ $ept_core_mobile_breakpoint, $ept_core_tablet_breakpoint, $ept_core_xxsmall_width, $ept_core_xsmall_width, $ept_core_small_width, $ept_core_default_width, $ept_core_large_width, $ept_core_xlarge_width, $ept_core_xxlarge_width, ]; // Get the unique breakpoints removing the repeated values. $unique_breakpoints = array_unique($breakpoint_values); // If there is repeated breakpoints, set a validation in the form error. if (count($breakpoint_values) !== count($unique_breakpoints)) { $form_state->setError($form, $this->t('All the breakpoints must be different')); }
So the count of the
$breakpoint_values
is not equivalent to the count of$unique_breakpoints
. But aside from that I noticed that in the array of$breakpoint_values
that$ept_core_desktop_breakpoint
is also missing. So that is why I only needed to change the mobile and table breakpoint values. Should the breakpoint values be mixed with the Width values in this form validation check?Also Is it really necessary for the Breakpoint values to be different from the Width values? If so, then perhaps a proposed solution could be to set the default Breakpoint values to be different from the Width values at module installation time in ept_core.settings.yml.
Hope that helps.
-
levmyshkin →
committed a38484d5 on 1.4.x
Issue #3460052 by axle_foley00: EPT Settings All the breakpoints must be...
-
levmyshkin →
committed a38484d5 on 1.4.x
- 🇷🇸Serbia levmyshkin Novi Sad, Serbia
Hi axle_foley00, thank you for your report! We had the same problem with EBT module:
https://www.drupal.org/node/3456572 →I removed these variables from validation:
$ept_core_mobile_breakpoint, $ept_core_tablet_breakpoint,
And released changes in 1.4.11 version:
https://www.drupal.org/project/ept_core/releases/1.4.11 →You just need to update EPT Core module with composer:
composer require drupal/ept_core:^1.4.11
- Status changed to Fixed
6 months ago 8:14am 9 July 2024 - Status changed to Fixed
6 months ago 8:14am 9 July 2024 - 🇯🇲Jamaica axle_foley00
Hey levmyshkin, okay great! Thanks. Confirming it is fixed in the latest update.
Have a great day.
- 🇯🇲Jamaica axle_foley00
I forgot to ask, should the wording in the comments and error message also be updated so say 'width' instead of 'breakpoints' as was done in the EBT module fix?
For example:
// Define the array with breakpoints values.
should be
// Define the array with width values.
and
// Get the unique breakpoints removing the repeated values.
should be
// Get the unique width values removing the repeated ones.
and
$form_state->setError($form, $this->t('All the breakpoints must be different'));
should be
$form_state->setError($form, $this->t('All the width values must be different'));
and so on?
- 🇷🇸Serbia levmyshkin Novi Sad, Serbia
Yes, sure, thank you! I will fixes for comments and texts in the next release, since it's not urgent and doesn't affect on functionality.
- 🇷🇸Serbia levmyshkin Novi Sad, Serbia
Updated comments and messages in 1.4.x branch.
- 🇯🇲Jamaica axle_foley00
@levmyshkin, okay thanks. I'll update the modules in my install to get the new changes.