Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
TR CreditAttribution: TR commentedA 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.
Comment #4
TR CreditAttribution: TR commentedI 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.