I'm working on a project where I'm using Physical Fields to store dimensions of products. I'm working down my spec document's field list and realize in addition for fields for Length (m) and Volume (m^3), I also need a field for Area (m^2).

I've checked the dev version and Area seems completely absent from Physical fields.

I actually need this desperately enough to be willing to work on this myself. Would anyone object to me working on an Area patch for 8.x-1.x-dev? I'd basically attempt to replicate what was done for volume: (sq cm, ft, in, m, mm, hectare?, acre?).

Or does this instead belong in an add on module of some kind?

CommentFileSizeAuthor
#5 2840867-area-field-type-5.patch5.48 KBtrevorbradley

Comments

TrevorBradley created an issue. See original summary.

bojanz’s picture

Sure, go ahead and add Area. I have no objections to having it inside this module.

trevorbradley’s picture

Thanks @bojanz! I'll get to work on it, and hope to have something up by tomorrow.

bojanz’s picture

As for which units to include, I just went with the most popular ones, and figured people would patch-in any missing ones that are important. It's more sensible than shipping with 30 possible ones like some modules do.

trevorbradley’s picture

Status: Active » Needs review
StatusFileSize
new5.48 KB

OK, here's a first area unit patch, with test. Looks good to me at first glance. Tested locally with phpunit, so in theory this should pass. :)

bojanz’s picture

Title: Area field type? » Add the area measurement type

  • bojanz committed c81d183 on 8.x-1.x authored by TrevorBradley
    Issue #2840867 by TrevorBradley, bojanz: Add the area measurement type
    
bojanz’s picture

Status: Needs review » Fixed

Made a few tweaks to the MeasurementTypes class (so that the types are alphabetic), expanded the README, and committed. Thanks!

trevorbradley’s picture

Redeployed 8.x-1.x-dev. Looks great @bojanz! Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.