Closed (fixed)
Project:
Measured Value Field
Version:
7.x-1.0-alpha2
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Nov 2010 at 13:39 UTC
Updated:
10 Feb 2013 at 11:20 UTC
hey
are there plans for a drupal 7 port and a drupal 6 upgrade?
CCK 3.x is in development for D6 and Fields is now present in D7 core, with optional contrib 3.x modules (cck project)
Comments
Comment #1
crea commentedWell I don't plan to do it myself, cause I'm not going to use D7 in the near future. I think MVF works fine with CCK 3.x (I use that myself).
Comment #2
BenK commentedSubscribing
Comment #3
kehan commentedsubscribing
Comment #4
entrigan commentedHey guys, I put together my own compound measured value field and uploaded it as a sandbox project http://drupal.org/sandbox/entrigan/1194886 . Do not want to create a duplicate project until the best solution can be worked out.
With that said, my module is super simple, and has no integration with unit api (which is good for weight, bad for functionality). I will be willing to collaborate on a full port if there is interest, but I think unit API will need to go alpha at least.
Comment #5
crea commentedComment #6
lpalgarvio commentedComment #7
bleen commentedsub
Comment #8
rorymadden commentedsub
Comment #9
escore commentedI tried #4 (Quantity Unit field module) briefly and even though it looks promising, I couldn't get it to work properly (e.g. any value/unit pair I added turned into "miles"). Unfortunately, I'm not at ease using a sandbox module with only one commit and no issues ;-) I'll give it another try when I have more time. Anyone have any other workaround for adding units to values in D7? I was thinking field collections could be a way to go but it seems a bit awkward.
Comment #10
akamaus commented@entrigan, I don't know about a full port of mvf. For example, the diapason functionality is rarely needed for me. But I think it would be great to have an integration with the unitsapi to be able to convert say, between horse powers and watts.
Comment #11
adam_b commentedsubscribe
Comment #12
slucas commentedI would be also greatly interested in seing this module ported.
Is there any alternative ?
Comment #13
denes.szabo commentedThere is a module by entrigan (see above) and I made an improved version from it: http://drupal.org/node/1457990#comment-5656018
Comment #14
johnvI have tested #13, and it works nice.
Comment #15
lolandese commentedFor some use cases the Double field module can be an alternative.
Comment #16
nvakensubscribing
Comment #17
bucefal91 commentedHello!
I can see there is a bunch of people desiring D7 version of this module. As a matter of fact, I need it too for my own project. A week ago I was kindly granted access to this module and units (http://drupal.org/project/units) by crea and I am looking forward to developing and support 7.x branch. I don't have much done yet, but I am working on it.
I have been thinking about the best approach. So far I think a quite good one can be:
In Units module:
define a hook in units module allowing other modules to supply meta info about unit measures and how you can convert values between them. Then convert that meta info entity - define 2 new entity types - Measure (a physically measured entity, ex: length, weight, area, etc) and Units (units in which physically measured entities can be measured, ex: cm, foot, pound, kg, etc). Additionally we can put on top of it UI allowing to add/edit/delete/override the meta info supplied in the hook. For example, if for any reason you want in your website 1 m to be equal 50 cm instead of normal 100, you will be able to edit the meta info via that UI without having to write your own module and override the meta data in hook alter. Define a public API (function) for converting a value from one unit to another. Supposedly function will be taking in value, unit from which to convert and unit into which to convert.
In MVF module:
Define a new field type: Measured Value, which is going to consist of a float number + entity reference, which will be pointing to one of Units entities, in which the value is stored. Then, in formatters of this field you will be able to specify in what units you want to display the stored value. The formatter will be using the public API of units module - that function that converts value from one unit to another.
Now, the whole juicy part would be to decide in what units to show the value based on what is known about the current user. Maybe based on what country he comes from, or what units are chosen in the settings of his profile, etc... This kind of functionally having this entire background done, would be easy to do in formatter for Measured Value field.
That's how I hope to develop both modules. I have been thinking about it for some time. The only disadvantage is that maybe using entity for each Unit is a little "heavy" approach. But this allows us to take the whole advantage of Entity Reference module, which probably will ease out Views integration and will help to outsource a lot of work into Entity Reference module in regards to how we want to show the units (full label, short label, label + description, etc... i.e.: "meter", "m.", "meter, it is a unit measure widely used through out the world bla bla bla").
Right now I have done only Units module - the hook that collects info from other hooks and I got created the 2 entity types (one for Measures and another for Units). I still need to make the hook create those entities and I am half done with the public function-converter between units. And I have some experience in merging 2 fields into, as I will need to merge number field and entity reference into one single field. I was able to merge similarly number and taxonomy term reference, delegating widget generation and other Field API hooks calls down to both sub-fields and then just collecting their output and joining it into one output sent back to Field API.
If you know some better approach to the problem, please, reply here, before I got too deep into mine mistaken ;)
Comment #18
bucefal91 commentedGuys, there are available first releases of Units and MVF modules for Drupal 7 version. They are quite stable as I have tested them. Go and give them a try!
Comment #19
lolandese commented#18: We are lazy enough not to use the search field.
Why not provide the links to those?
Comment #20
pepperstreet commented@bucefal91
Many thanks for your help and contribution! Might come in handy... really looking forward to it.
Comment #21
bucefal91 commentedNo problem. I needed this functionality for my own website. I hope to add Views integration for those field types with time :)
Comment #22
johnvThanks for the D7 version! We will post separate follow-up issues when necessary.