Slight refactoring for the unit display logic to tighten it up a bit and exclude 'units' from displaying as a unit of measurement. I may not be familiar with recipe formatting reasons to do it, but if it's not worth showing the text plainly visible (and I don't think it is) it's not worth showing a distracting abbreviation-of-whitespace to say it's a unit.
Filing as a bug report, but it's one of those murky sorts of issues...
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | remove-blank-unit-1590220-6.patch | 1.17 KB | jvandervort |
| #5 | 1590220-5-empty-unit-abbreviation.patch | 5.13 KB | dcam |
| #1 | 1590220-remove-blank-unit-abbr.patch | 5.04 KB | dcam |
| recipe.unit_no_abbrev.patch | 1.35 KB | Grayside |
Comments
Comment #1
dcam commentedI'm sorry it's taken me so long to get to testing all of these new patches. I'll try to get through them when I can to help out.
This issue was of particular interest to me. In the recent project I was working on that involved Recipe, the client asked me to remove these blank abbreviations too. I haven't yet been able to find a reason why they're displayed like this.
The patch in the OP had 1 whitespace error, which was easy to fix. It also didn't account for the other blank abbreviation unit, "unknown." I added the unit. Then I took the opportunity to clean up the function a bit, including parts of it that seemed leftover from earlier versions of the module.
I don't mean to take away from Grayside's attempt to patch the issue and it's also possible that I did too much. If I need to re-roll the patch and scale it back, I can.
Comment #2
dcam commentedComment #3
dcam commentedGo, testbot.
Comment #5
dcam commentedHere's another patch which doesn't try to do so much.
Comment #6
jvandervort commentedThat's funny, I was just looking at this.
Let's compare
Comment #8
jvandervort commentedI think I like yours better, ie using the empty abbrev to key off of.
Do you run the unit tests before posting?
Comment #9
dcam commentedYeah, I checked yours and I see what you're trying to do, but I prefer mine too.
Comment #10
dcam commentedI did run the tests in this case because I knew the patch would break a few asserts since there were some specifically checking for the empty abbr tag. I won't for every patch. It takes a long time to run all of the tests locally. I didn't time it or pay close attention, but I think it was about 15min. Testbot, however, can run them in just a minute or two.
Comment #11
jvandervort commented#5: 1590220-5-empty-unit-abbreviation.patch queued for re-testing.
Comment #12
jvandervort commentedPatch #5.
Comment #13
dcam commented#5 has been committed to 7.x-1.x.