Help Desk

Required fields are not applying to "Edit/Update" screens

  • Posts: 9 Topics: 3
    | Permalink

    We have implemented “required” fields for “Organizer Phone and Email” which work fine in the “community/add” screen, however, they have no affect in the “community/edit” screen. Thus, a user can bypass required fields by updating.
    Is there a way to stop this?

    Posts: 5927
    | Permalink

    Hi Mal,

    Thanks so much for reaching out!

    Would you mind sharing your method for making fields required?

    I just tested the functionality, using the following tutorial, and it worked in the Edit page as well.

    https://theeventscalendar.com/knowledgebase/required-fields-for-events-submission-form/

    Let me know if you have any other questions in the meantime!

     

    Thanks,

    Jaime

    Posts: 9 Topics: 3
    | Permalink

    Hello Jaime,

    Thank you for the response. This is exactly the document we followed using the exact code with the additional field:
    $fields[] = ‘Phone’;

    As mentioned, this makes “Phone” required for community/add (new entries) but one the event is added, you can go to edit event, edit organizer and “Phone” is no longer required. The “Phone” can be removed and the organizer updates without errors.

    If this is working properly in your setup, please provide a test link that we may compare with.

    Thank you.

    Posts: 5927
    | Permalink

    Hi Mal,

    Can you provide me with the exact code that you are using, as well as your system information in a private reply using the instructions found in the following link?

    https://theeventscalendar.com/knowledgebase/sharing-sys-info/

    Also, does the snippet provided in the article work for you if it is not an additional field?

    Let me know if you have any other questions in the meantime!

     

    Thanks,

    Jaime

    Posts: 9 Topics: 3
    | Permalink
    This reply has been marked as private.
    Posts: 5927
    | Permalink

    Thanks for providing me with that information.

    I am seeing some errors related to that code.  Just to let you know, we are limited by our Support Policy in how much we can help with customizations, but I will try to point you in the right direction.

    I’d recommend starting off by updating your PHP version to at least 5.6, as recommend here:

    https://theeventscalendar.com/php-version-requirement-changes/

    Let me know if that helps!

     

    Thanks,

    Jaime

    Posts: 9 Topics: 3
    | Permalink

    Hello Jaime,

    Could you please clarify “I am seeing some errors related to that code”. Are these errors with the code we are using (straight out of the example) or code at your end?

    The system info was from a development server. The production server has PHP 5.6 and the problem still exists.

    Thank you.

    Posts: 5927
    | Permalink

    I see the following error when I use your code on my site:

    PHP Warning:  Use of undefined constant ‘my_organizer_community_required_fields’ - assumed '‘my_organizer_community_required_fields’' (this will throw an Error in a future version of PHP) in /Users/xxxx/Sites/test-site/wp-content/themes/twentyseventeen/functions.php on line 25

    I hope this helps to clarify things for you!

    Thanks,
    Jaime

    Posts: 9 Topics: 3
    | Permalink

    Hello Jamie,

    Actually no.

    1. Warnings should not cause errors and defiantly should not cause “Add” to function properly and “Edit” to not function.

    2. From your output, the assumed is exactly the same as the called?

    3. This code is a direct copy and past from your example/tutorial at:
    https://theeventscalendar.com/knowledgebase/required-fields-for-events-submission-form/

    Posts: 5927
    | Permalink

    I’m sorry that you have not been able to get this to work.  I can tell you that on my test site, I am able to get the code from that knowledgebase article to work as expected.  This code works on both the Community Add and Edit pages.  Do you see the same results?

    Let me know!

     

    Thanks,

    Jaime

    Posts: 9 Topics: 3
    | Permalink

    Hello Jaime,

    Would I be able to try this on your test site?

    Are you sure you are testing following these steps:

    Go to <url>/events/community/add
    Login as a subscriber
    Fill out event information
    – Organizer Phone and Email are required fields and this works fine.
    After submitting the event go to <url>/events/community/list
    Select the event for editing
    click on “Edit Organizer”
    clear out the Phone and/or Email (which where required fields on “Add Event”)
    click on “Update Organizer”
    – no errors are produced and the Phone/Email are blank, thus, bypassing the requirements.

    Posts: 5927
    | Permalink

    Unfortunately my test site is a local site, so it is not accessible for testing.

    Using the code you provided, the fields do not become “required” at all.  However, I have tested this functionality with the required Event URL snippet provided in that article and followed the steps you outlined.

    In that case, if I removed the Event URL in the Community Edit page, I did receive error, so I was unable to reproduce the error that you are describing.

    In any case, we are limited in our assistance with custom coding here, as per our Support Policy.

    If you’d prefer not to tackle this customization on your own, we may be able to assist you further. We do need to prioritize support requests from other customers at this time but I’ll certainly flag this with the team and – although we can’t make any promises – if we have time and space to come back and help, we’ll be happy to do so.  Please let us know if you’d like to go this route so that you can be added to this queue.

    In the meantime, if there is any more information you can share (including mocks) that will help us to better understand what you are seeking please do feel free to add them to this ticket.

    If you urgently need help with this, however, you may instead wish to consider working with a suitably skilled developer or designer who can offer the additional level of support you require.

    Let me know if you have any other questions on this topic!

     

    Thanks,

    Jaime

    Posts: 9 Topics: 3
    | Permalink

    Hello Jamie,

    I’m very confused. The code I am using and sent to you, is your code from the tutorial/example.

    Can you please explain “if I removed the Event URL in the Community Edit page”?

    Thank you.

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    Hi @themal,

    Thanks for your patience so far.

    I think I see the disconnect, which is that you are expecting the required field logic you added to work in the frontend edit screens for organizers and venues whereas it is designed only to function in the context of the event editor.

    I realize this may not be ideal, and will log a ticket to make things a little more flexible (and will also update the knowledgebase article to make the limits of this approach a little clearer).

    Our apologies for any confusion that’s been caused.

    Posts: 65
    | Permalink

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

    | Permalink
    Posts: 6518
    | Permalink

    Hi there

    We have just shipped an update to our plugins that should resolve this. https://theeventscalendar.com/maintenance-release-for-the-week-of-2-december-2018/

    Please back up your sites before upgrading, but do test it and let us know if it works for you.