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...

Comments

dcam’s picture

StatusFileSize
new5.04 KB

I'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.

dcam’s picture

Status: Active » Needs review
dcam’s picture

Go, testbot.

Status: Needs review » Needs work

The last submitted patch, 1590220-remove-blank-unit-abbr.patch, failed testing.

dcam’s picture

Status: Needs work » Needs review
StatusFileSize
new5.13 KB

Here's another patch which doesn't try to do so much.

jvandervort’s picture

StatusFileSize
new1.17 KB

That's funny, I was just looking at this.
Let's compare

Status: Needs review » Needs work

The last submitted patch, remove-blank-unit-1590220-6.patch, failed testing.

jvandervort’s picture

I think I like yours better, ie using the empty abbrev to key off of.
Do you run the unit tests before posting?

dcam’s picture

Yeah, I checked yours and I see what you're trying to do, but I prefer mine too.

dcam’s picture

I 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.

jvandervort’s picture

Status: Needs work » Needs review
jvandervort’s picture

Status: Needs review » Reviewed & tested by the community

Patch #5.

dcam’s picture

Status: Reviewed & tested by the community » Fixed

#5 has been committed to 7.x-1.x.

Status: Fixed » Closed (fixed)

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