• Resolved haizdesign

    (@haizdesign)


    My event submission form is set to allow anonymous event submissions. However, I am still seeing the frontend page with an Unauthorized Access notice for non-logged in users.

    I have followed all the advice in the docs, created a new subscriber-level user and set user capabilities to allow subscribers to edit events.

    Any ideas so I can get this working please?

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Looks like you are trying to edit an event as an anonymous user. If you want to allow that then you would need to add the edit_others_events capability to the subscriber-level user (not recommended!).

    Thread Starter haizdesign

    (@haizdesign)

    Thanks for your reply. I’m not trying to edit an event but display a page where anonymous users can view the form to create and submit events.

    Try creating a new page. Then in Events Manager settings in the Pages tab click on Other Pages and then under “Front-end management pages” select the new page from the pulldown for the “Edit events page”. After that non logged in users should be able to go to that page to create events.

    Thread Starter haizdesign

    (@haizdesign)

    Thank you – that worked. It seemed to play nicely with creating a new page after setting the anonymous submissions option.

    Thanks; this should help with my site, too—just wondering about using an old page, as I have the event-submission form below the calendar on the existing Events page. I’d prefer to avoid recreating that page.

    I don’t know a way to fix the case when the event-submission form is on the same page as the calendar. I think that would require an update to the plugin.

    Thread Starter haizdesign

    (@haizdesign)

    I thought I had this fixed. However, a theme (and other) updates have set back my page to unauthorised access:
    https://kph.naturallylewes.co.uk/book-the-hall/

    Is there any way to avoid this happening?

    Create the directory wp-content/plugin-templates/events-manager/forms and copy wp-content/plugins/events-manager/templates/forms/event-editor.php to that directory. Then modify the copied version by changing the following lines (lines 11 through 18):

    if( is_object($EM_Event) && !$EM_Event->can_manage('edit_events','edit_others_events') ){
        ?>
        <div class="wrap"><h2><?php esc_html_e('Unauthorized Access','events-manager'); ?></h2><p><?php echo sprintf(__('You do not have the rights to manage this %s.','events-manager'),__('Event','events-manager')); ?></p></div>
        <?php
        return false;
    }elseif( !is_object($EM_Event) ){
        $EM_Event = new EM_Event();
    }

    To this:

    if ( !is_object($EM_Event) || !$EM_Event->can_manage('edit_events','edit_others_events') ) {
        $EM_Event = new EM_Event();
    }
    
    Thread Starter haizdesign

    (@haizdesign)

    Fantastic! Thank you. That worked and scanning the code, looks like a permanent fix.

    Thread Starter haizdesign

    (@haizdesign)

    I spoke too soon! The page displays but the processing of the form doesn’t happen. The success message doesn’t appear and no form content is passed to the backend.
    I have tried adding a new page and updating the settings so it points to that, but no luck.

    Also, cleared the cache and tried different browsers.

    I was not able to reproduce the problem you describe. Try disabling all other plugins and switch to a default theme like Twenty Twenty-Four and see if you still see this problem.

    Thread Starter haizdesign

    (@haizdesign)

    Thank you for your patience and great support. I really appreciate the advice on the php edit.

    After going through the process of deactivating plugins and changing themes, I realised and promptly slapped my head…

    I hadn’t set user capabilities to allow for editing of events and recurring events!

    I’m currently trying to persuade the venue to pay for the Pro licence so we can edit the booking forms and export events. Your support will help with the sell on that. Thanks again.

    Editing the “event-editor.php” code works for me… any chance of an official update of the plugin to fix this mistake?

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Anonymous event submissions’ is closed to new replies.