In Cart Links message list, I included a blank line in the middle to provide separation between product types, to make the list easier to read, however... the blank line causes an error to appear every time something is added to the cart via cart link.

Removing the blank line fixed the problem, i.e. no more error message.

Comments

TR’s picture

Version: 7.x-3.1 » 8.x-4.x-dev
Category: Bug report » Feature request

A couple of things here:

First, I can't reproduce this. If I leave a blank line in the message textarea, then click a cart link that uses that message ID (or some other message ID defined either before or after the blank line), then I see no errors. You didn't tell us what the error message said, so I can't guess what was happening in your case.

Second, this is not a bug since you're not following the instructions for the format of the message. However, there should be some validation of the message on the admin form so that it fails if the admin enters bad information - the fail should not be delayed until the link is actually used.

Better yet, we shouldn't be using a textarea here - the internal storage of the data (separated by "|") shouldn't be the admin's concern. Instead we should have two textfields, one for the message ID and one for the message, plus an ajax button to add more textfield pairs for more messages.

Turning this into a feature request. New features will be implemented in the latest version of Ubercart (8.x-4.x) first, then backported if there is demand.

  • TR committed 6394063 on 8.x-4.x
    Issue [#2186849] by TR: Add validation of cart links messages and allow...

  • TR committed 56ca64d on 7.x-3.x
    Issue [#2186849] by TR: Add validation of cart links messages and allow...
TR’s picture

Component: Cart/checkout » Cart Links
Status: Active » Fixed

I added validation of cart links messages and added code to prevent PHP notices in the case of blank lines in the message area. I also backported this to D7.

  • TR committed 1e5602e on 8.x-4.x
    Issue [#2186849] by TR: Allow any whitespace on blank lines.
    

Status: Fixed » Closed (fixed)

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