Closed (fixed)
Project:
HMS Field (Hours Minutes Seconds)
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Nov 2015 at 06:11 UTC
Updated:
5 Oct 2016 at 11:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
steffenrComment #3
steffenrComment #4
steffenrAttached you find a big patch of the module rewrite - tested with drupal 8 RC3. I used drupal console module to build the sceleton for the files and used the existing functions in the new structure.
All the helper functions where moved into the HMSService and can be used via dependency injection or just by calling directly via drupal service container.
Validation partly working for now
For now the field element validation won't work correctly, cause i could not figure out how to handle the valueCallback function in conjunction with empty field content.
If you enter non matching values in the form element it'll save, but won't output the content. Maybe someone can have a look at the validateHMS and valueCallback function to fix the issue.
Comment #5
steffenrComment #6
steffenrComment #7
steffenrAfter a short break and a recap of the validation / value callback methods i got the validation working ;)
Finally i fixed the valueCallback / validateHMS methods and got it working. Even empty values are now handled correctly. The latest patch is rerolled against the latest DEV version of the module.
Please review the patch and provide feedback.
Comment #8
steffenrComment #9
steffenrComment #10
steffenrComment #11
jeffschulerWorking well for me, so far.
Thanks for the rewrite, SteffenR!
Comment #12
bugeyed commentedSteffenR, very much appreciate the rewrite/port. I've made a slight modification to HMSFieldWidget.php to output the form element as type="time" to make it a little more end-user friendly.
This is my first time uploading a file, please let me know if I've done so correctly.
The patch file is the file: hms_field/src/Plugin/Field/FieldWidget/HMSFieldWidget.php explicitly with a small change to line 107
'#attributes' => array('class' => array('hms-field'),to
'#attributes' => array('class' => array('hms-field'), 'type'=>'time'),Comment #13
steffenr@bugeyed
Thanks for providing feedback and adding some extra
Please have a look at the d.o guidelines, how to create a patch. Right now you have copied the whole file and made this little change.
Comment #14
andypostCan we get the patch commited?
Also it makes sense to create a beta release after that
Comment #15
andersen_ti commented7 and 12 patches combined into one
Comment #16
andypostPlease accept this patch and roll out beta release
Comment #17
steffenr@Andypost
Unfortunately i could not get any response by the current module maintainer. I already opened an issue according this fact.
Maybe we should try contacting him again - would be great to have a beta release for the D8 branch of the module.
Comment #18
andypostThere's a procedure for that case https://www.drupal.org/node/251466
Comment #20
ws.agency commentedThank you all for the patches and review. We took maintainership of the module and just released beta 1 for D8.
https://www.drupal.org/project/hms_field/releases/8.x-1.0-beta1
Comment #21
ws.agency commented