WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
Ticket price mandatory -> empty price field error deletes inputs (10 posts)

  1. sonnensegler
    Member
    Posted 2 years ago #

    I just updated to Version 4.301. Everything's fine, except that when setting up a new event, activating registration with a ticket and leaving out the "Price" field, events-manager will throw an error that says "Please enter a valid ticket price e.g. 10.50 (no currency signs)". Plus, all the entered information is gone, the event is not saved.

    Since we have events that are free, we currently solve it by entering 0.00.

    How can I deactivate mandatory ticket pricing? I've searched the settings but couldn't find anything...

    Thanks in advance, Christiane

    ps: btw I tried updating to 4.302 but I would still have the "New version 4.302 available"-info. I'll get into that and post a new ticket on it as soon as I have figured out what happened.

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    thanks, will fix that.

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    fyi, about the update not showing 4.302, tried on a couple of sites and it does update for me.

  4. sonnensegler
    Member
    Posted 2 years ago #

    Thanks!

    Update to 4.302 works now. Nothing to worry!

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    btw, the dev version also is fixed regarding the event not allowing free/no-price tickets being saved

  6. matt333
    Member
    Posted 2 years ago #

    Marcus,

    Thank you for your always fast response.

    I'm on EM 4.302 and BP 1.51, and I was about to ask the same question. Where can I find dev version?

    BTW, as I see it, this is not a very proper way to submit bugs and ask for features. Any plans for public bug tracking and even code contributions? For bugs, I would recommend a web-based tracking site, such as fogbugz.

    This is what I see on the ticket_price issue, hoping that I am helping instead of distracting:

    The ticket_price and some other fields (e.g. ticket_start, ticket_min) of EM_Ticket class have a uniform behavior that you probably intended: if empty(ticket_price), save to DB as NULL.

    The two places where this behavior shows: EM_Ticket::save(), EM_Object::to_array(). The latter is used all over the place, affecting booking, location, category, ticket_booking, etc. So changing this behavior, even for ticket_price alone, might have unwanted consequences without thorough investigation. And all the changes are in EM code, rather than templates, which will have to be merged again at future EM updates.

    So I do not want to touch it but propose the following fix:

    == Proposed untested idea of future fix:
    EM_Ticket::

    price = 0; (as default value, in declaration)
    fields: add a 'allow_zero_value'=>1, to ticket_price(and possibly other similar fields), at declaration
    save(): change: if ( empty($this->$field['name']) && $field['null'] ) to: if ( empty($this->$field['name']) && $field['null'] && ! $field['allow_zero_value'])

    EM_Object::

    to_array(): change:if ( !empty($this->$val['name']) || empty($val['null']) ) to: if ( !empty($this->$val['name']) || empty($val['null']) || $field['allow_zero_value'])

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    http://wordpress.org/extend/plugins/events-manager/download/

    pro area has a bug tracker, for free would rather use this for now.

    will look into the ticket issue

  8. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    had a look at this, what's the problem with a null value? i don't see any adverse behaviour, null resolves to 0 using $EM_Ticket->get_price();

  9. matt333
    Member
    Posted 2 years ago #

    Marcus,

    I tried 4.303 and it's fine this way (null) now. I'll look more carefully into pro. (Good to know pro has bug tracker.)

  10. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    we use a modded version of faultpress fyi

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic