The <em></em> HTML tags show in the disabled button when a signup has completed for a node

So for an Event type the button shows:
"We're sorry, but the Event <em>Event Name</em> has already passed"

Comments

faite’s picture

I had the exact thing happen to me seemingly out of nowhere. People were signing up and suddenly this came up and nomatter what I do I cannot convince the event that the time has in fact not passed.

ezra-g’s picture

Version: 6.x-1.0-beta4 » 6.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

Does this happen with the latest dev version?

dca123’s picture

Yes.

dca123’s picture

StatusFileSize
new1.33 KB

I have fixed it here on my end and made a patch file but it's the first one I've done. Don't know if I did it right or not...

dca123’s picture

Just to be specific it doesn't fix faite's issue, just the one I asked about ;)

lunk rat’s picture

I have REALLY long signup node titles, and when my events pass and it displays this button, the button is five miles past the right margin.

I had to change uc_signup.module to print "Registration is closed" instead of the @type @title variables. Long node titles make huge buttons that break layouts.

Maybe want to consider a UI config option for this text in a future release.

ezra-g’s picture

Status: Postponed (maintainer needs more info) » Needs review

I feel like the best solution is to move this text out of the button completely. Here's a patch and a screenshot showing a disabled button that keeps whatever text has been set, and then adds this text below it.

Also, we currently don't disable the button unless the user has entered default "sign up for this event" uc_signup button text at admin/store/products/signup. This patch disables the button regardless of whether that text is entered. Also, I'd like that variable to be set by default, but I'll put that in another issue.

ezra-g’s picture

StatusFileSize
new1.38 KB

Only local images are allowed.

ezra-g’s picture

bewhy’s picture

I like dcal123's method/patch (as in #4) better simply because adding the line below (as in #8) interferes with my layout. I changed the text to "this event has already happened", which gets around both the problem and the potential for the button to get very big if there is a long node title.

And more generally, I'd rather like to edit the text of the button than add a new line of text.

kclarkson’s picture

I am having the same issue as well. I am a drupal newbie and would like to add your patch. Could you provide me with a little more info as to what file and "where" to apply your patch.

Also I am trying to get an understanding of "patches" in general. When somebody creates a patch do these get added to the module. It just seems like people always say, "there is a patch that fixes that" but its hard to find them.

thanks,

ezra-g’s picture

Title: "We're sorry, but the [Content Type] <em>[Name]</em> has already passed" shows in button » Better IA for closed events
agentrickard’s picture

StatusFileSize
new7.67 KB

Note also that this should likely disable the entire form, not just the button.

See the attached, which shows the 'variable price' feature form element still active.

YK85’s picture

subscribing

jedsmith13’s picture

It seems to me that the text that should be assigned is that found in the "Signups closed text" field at /admin/store/products/signup. It seems counter productive to ask for some text to put on a button (which sounds like it should cover signups being closed for any reason) and then use hard-coded text instead.

I think something like the suggestion for #8 would be best only instead of just disabling the button used the text entered in the "Signups closed text" field at /admin/store/products/signup. Then on the settings page add a couple of fields where the user could edit the help text displayed with the button, maybe even allow the use of tags like [title] and [type].

ezra-g’s picture

Status: Needs review » Fixed

I've committed a fix for this that takes into account the feedback in this issue:

http://drupalcode.org/project/uc_signup.git/commit/9a1c39d

Some notes:

- Per comment #13, uc_signup already disables $form['qty'] when it's presented to the user and signups cannot be purchased for the node.

- $form['qty'] is always set, it's just that it is a #type=> 'hidden' element when the "Display an optional quantity field in the Add to Cart form." is not enabled at admin/store/settings/products/edit .

- Setting #disabled on the submit and quantity fields are sufficient for preventing form submit handlers from running because even if someone manipulates the DOM to make the elements not disabled, uc_signup_product_add_to_cart_form_validate() still enforces _uc_signup_node_available().

- This revision uses the slightly less evil approach of span + css instead of br tag to make the event closed text appear below the signup/add to cart button by default.

- This patch changes the code_flow of _uc_signup_node_available() to use the user-configured value last, so that it does not get overwritten per comment #15

I committed this change since it seems sufficient and certainly less obviously broken than having markup inside a submit button but am of course open to improving the IA here further.

Status: Fixed » Closed (fixed)

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