- 🇨🇦Canada metasim
The patch applies successfully, except on the .info.yml file at line #5 on
core_version_requirement
,
range_slider.info.yml.rej:
--- range_slider.info.yml (revision 7c067925566449a7e7830c746fc3dde7a108ba1a) +++ range_slider.info.yml (date 1677972525355) @@ -2,4 +2,4 @@ type: module description: Integration with https://rangeslider.js.org core: 8.x -core_version_requirement: ^8 || ^9 +core_version_requirement: ^8 || ^9 || ^10
Also while testing the patch I get a js error
Uncaught TypeError: $(...).find(...).findOnce is not a function
on `range_slider/js/range-slider.js:59`
The new replacement for the same is once.filter() as per this →
Based on this I think the findOnce() can be replaced with the following line of code by making use of the once.filter()
const filteredElements = once.filter('rangeSlider','.form-type-range-slider input, .js-form-type-range-slider input'); filteredElements.forEach(function () { $(this).rangeslider('destroy'); })
- Status changed to Needs work
over 1 year ago 11:14am 8 March 2023 - 🇫🇷France lazzyvn paris
@metasim
should i remove core 8.x in info?
line 59 can we make ? like this? $(context).find('.js-form-type--range-slider input').once.filter('rangeSlider').rangeslider('destroy');
i dont know how to testbe aware that the input class is now js-form-type--range-slider (double --) and no longer js-form-type-range-slider (maybe work with jquery )
@baikho I commit but git is not allowed to make a merge request. Another module I can make a merge request - @lazzyvn opened merge request.
- @lazzyvn opened merge request.
- 🇨🇦Canada metasim
@lazzyvn I tried testing the new MR, for some reason the diff.patch still fails on .info.yml file
--- range_slider.info.yml +++ range_slider.info.yml @@ -1,5 +1,4 @@ name: Range Slider type: module description: Integration with https://rangeslider.js.org -core: 8.x -core_version_requirement: ^8 || ^9 +core_version_requirement: ^8.8 || ^9 || ^10
After manually changing the core_version_requirement and adding ^10 to it I tested it.
Findings:
Drupal Test Version: 10
Browsers Tested on: Chrome and FirefoxThe module seems to work fine on both, see the attached screenshots.
However If you look at the element classes I did not find the class mentioned by you with double dash i.e
js-form-type--range-slider
I found 2 classes namely
js-form-type-range-slider
&form-type--range-slider
Based on the screenshots when I click the submit button the value seems to update fine based on the position of the slider.
- 🇫🇷France lazzyvn paris
I check claro theme core/themes/claro/templates/form-element.html.twig
there is 'form-item--' ~ name|clean_class, on line 23
so i think it's better if we take 'js-form-type-'~type as selector
I add option use library, if we don't want to use rangeslider.js library, we can use original type range html5, it will be easy to customize with css.
I create a new merge request
I also add a patch
Please merge and release new version for drupal 10 - 🇨🇦Canada metasim
@lazzyvn I tested this patch on Drupal core version 9.5.9
The patch applies successfully,
On testing this range slider on a custom form,
There were no errors on console or php.On submit the range slider returns the values as expected .
- last update
over 1 year ago 2 fail - 🇧🇪Belgium baikho Antwerp, BE
- 🇫🇷France lazzyvn paris
Pardon my ignorance, but why are we changing the class to .js-form-type--range-slider input? This will likely break any JS or CSS in existing projects. What theme are you using?
No it doesn't.
I checked all theme you can find in
\web\core\themes\[theme]\templates\form-element.html.twigor another theme admin like Bootstrap 5 admin, Gin ...
it uses always'js-form-type-' ~ type|clean_class,
'form-item-' ~ name|clean_class,Only claro theme have
'js-form-type-' ~ type|clean_class,
'form-type--' ~ type|clean_class,
'form-item--' ~ name|clean_class,So the best selector for all of theme is
'js-form-type-' ~ type|clean_class, - 🇧🇪Belgium baikho Antwerp, BE
#19 Thanks for clarifying.
Sorry, I see now that the selector in patch #13 is correct, I was looking at Merge request 4 https://git.drupalcode.org/project/range_slider/-/merge_requests/4#note_.... I'll update the MR accordingly.
- 🇮🇳India Raunak.singh
@baikho There is any timeline when we are able to see stable version of range_slider for drupal 10?
- 🇫🇷France lazzyvn paris
Oh i forgot to add \range_slider\config\schema\range_slider.schema.yml
use_library:
type: string
label: 'Use library'
step:
type: string
label: 'Step'that's why it fails the test. With this patch i think it will pass all test
- last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - 🇫🇷France lazzyvn paris
No, It says pass, there is a problem with git on Jenkins because branch 2.x is not release
Patch Failed to Apply - View results on dispatcher
fatal: git apply: bad git-diff - expected /dev/null on line 349
range_slider 2.0.x-dev branch result
PHP 8.1 & MySQL 5.7, D9.5 1 pass most recent, 10 Jun 2023 at 17:06 CEST
History
Updated Result
11 Aug 2023 at 11:14 CEST
PHP 8.1 & MySQL 5.7, D9.5 Patch Failed to Apply
11 Aug 2023 at 11:12 CEST
PHP 8.1 & MySQL 5.7, D10.0.7 Patch Failed to Apply - 🇧🇪Belgium baikho Antwerp, BE
- last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass - 🇩🇪Germany rhiss
Hi, just a little change to the patch because of "The 'core_version_requirement' constraint (^9.2 || ^10) requires the 'core' key not be set ..."
- last update
about 1 year ago 1 pass - Status changed to Fixed
about 1 year ago 6:27pm 25 August 2023 - 🇫🇷France lazzyvn paris
Oh you are right i forgot commit file Element/RangeSlider.php
if (!empty($element['#use_library'])) { $element['#attached']['drupalSettings']['range_slider']['elements']['#' . $element['#id']]['use_library'] = $element['#use_library']; }
I recommit right nows
It must show like this - last update
about 1 year ago 1 pass - @lazzyvn opened merge request.
Automatically closed - issue fixed for 2 weeks with no activity.