If you enable the barcode scanning module without installing the Quagga library you get a warning that you need it with a link to learn more, but a JS error occurs that breaks the POS; order item autocomplete no longer works.

POS shouldn't attempt to use the library if it isn't installed so the POS still works without scanning until the library gets installed.

Comments

tbradbury created an issue. See original summary.

safallia joseph’s picture

Status: Active » Needs review
StatusFileSize
new2.23 KB

The attached patch checks whether quagga lib is present before adding barcode scanning js and thus fixes the issue. Please review

jnrfred’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new27.99 KB

Patch tested and works for me. See attached

barcode

quietone’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new13.85 KB

Nice but the text used doesn't meet the Interface Text standards. Specifically,

Do not use contractions, like "you've", "can't", and "shouldn't", and so on. Use the complete phrase instead.

User interface text is not my area but I'd also like to see this a positive statement what the person has to do. The grammar is taken from MigrationConfigurationTrait in core. "Install the quagga library to use barcode scanning."

When adding a product at /admin/commerce/pos/main I get two instances of the message. Image attached.

Actually, the more I think about this, who is this message for? AFAICT it is for a developer or possibly an admin and yet it is displayed on a page seen by a cashier. It would be nice for the cashier to know if barcode scanning is available or not and maybe an icon can be used to let the cashier now.

I also think that this message should be in the install process somewhere. Or better, can't the library be included in composer to ensure it is available when installing the barcode scanning module?

I see two somewhat different issues to solve here
1) Make barcode scanning dependent on the qugga library.
2) Inform the cashier on the availability of bar code scanning.

smccabe’s picture

We should move the messaging to the status section, that is where stuff like missing libraries should go. It doesn't make sense to show this to a cashier, if we can't barcode scan we just shouldn't show any options.

Also I agree with switching it to positive of "Install the quagga library to use barcode scanning." instead of the negative.

jseniuk’s picture

Status: Needs work » Needs review
StatusFileSize
new575 bytes

The install script already shows a warning on the status page when quagga isn't found, so instead it can just be added as a dependency in the info file.

derekcresswell’s picture

StatusFileSize
new3.66 KB

Hello, I've taken the patch from #2 and changed wording based on #4

I've also removed the warnings from displaying on the cashier's order. Added a warning to when installing the module and to the help page to alert you if quagga is installed or not.

skyredwang’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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