XF2 [8WR] XenAtendo 2 (Calendar) PRO

XF2 [8WR] XenAtendo 2 (Calendar) PRO [Paid] 2.2.0.3

No permission to buy ($40.00)
There's a bug. If the forum is autoselected, then prefixes are not shown. If you manually select a forum, then prefixes show up.

@Jaxel

Any word on this? If the thread forum used requires a prefix, this bug makes your addon unusable!

The user will click save, the error "Please select a prefix" will be shown, but when the click the prefix drop down, nothing is there.

As BassMan says, you need to select another forum (or None) then back again to get the correct ones to show up.

In the meantime, for anyone else looking for a quick solution.

Edit Template: EWRatendo_event_edit

Find:
Code:
<xf:js src="8wayrun/atendo/calendar.js" />

Add Below:
Code:
<xf:js>
    $(function() {
        if ( $( "#atendo_node" ).length ) {
            $("#atendo_node").change();
        }
    });
</xf:js>

This simply causes a fake change event to occur (as if someone had clicked the dropdown) so will make the prefix dropdown refresh.
 
Last edited:
I just found out today that XenAtendo runs an extra query for EVERY THREAD that's ever displayed on any template (this is due to it overriding the $thread.title macro)

It does this so it can show the event date/location next to the thread title, but as you can imagine this isn't good. On a forum listing page, this will run at least 20 extra queries, regardless whether the thread is linked to an event or not.

Luckily this is a very easy fix :)

Firstly, the structure definition is wrong in "/EWR/Atendo/Entity/Thread.php"

It should be:
PHP:
    public static function getStructure(Structure $structure)
    {
        $structure = parent::getStructure($structure);

        $structure->getters['event_title'] = true;
        $structure->relations['AtendoEvent'] = [
            'entity' => 'EWR\Atendo:Event',
            'type' => self::TO_ONE,
            'conditions' =>'thread_id',
            'key' => 'event_id',
        ];

        return $structure ;
    }

This change is needed so the join will work correctly.

Secondly, you need to extend the XF\Repository\Thread class function:
PHP:
    public function findThreadsForForumView(\XF\Entity\Forum $forum, array $limits = [])
    {
        $finder = parent::findThreadsForForumView($forum, $limits);

        $finder->with('AtendoEvent');

        return $finder;
    }

This will create the relevant join, so no extra queries will be run when checking if a thread is an event or not.

For anyone who doesn't understand this, I've attached a small addon that will make the changes for you - attached.
 

Attachments

Last edited:
Gah, just realised that won't fix the latest posts page, or any of the widgets.

Hmm..

I guess the easiest way would be to add a defaultWith to the thread entity, although I don't know if this would have any performance consequences? You would no longer need to override findThreadsForForumView.

PHP:
    public static function getStructure(Structure $structure)
    {
        $structure = parent::getStructure($structure);

        $structure->getters['event_title'] = true;
        $structure->relations['AtendoEvent'] = [
            'entity' => 'EWR\Atendo:Event',
            'type' => self::TO_ONE,
            'conditions' =>'thread_id',
            'key' => 'event_id',
        ];
        
        $structure->defaultWith += ['AtendoEvent'];

        return $structure ;
    }
 
Interested, but I still couldn't figure out clearly if it's possible to import data from other lists. Is it possible or not?
 
Idea:
Set the $thread.cover_image variable to the event header image, so it can be properly picked up when sharing on social media.

Idea 2:
Use a custom thread type instead of hooking into the standard discussion thread. This will save on database queries (no longer need to check for $thread->AtendoEvent which will make a db call) and also allow things like custom thread icons, simpler integration of thread header etc etc
 
I am considering a purchase. I need to run a volunteer schedule to man events. Could I schedule multiple events, limit attendance, and allow them to RSVP for slots during a 2-3 days span?

How do I view the daily schedule?
 
Getting the following error when trying to submit an event:

Code:
Error: Call to undefined method GuzzleHttp\Psr7\Response::json() in src/addons/EWR/Atendo/Repository/Google.php at line 21
EWR\Atendo\Repository\Google->fetchGeoCode() in src/addons/EWR/Atendo/Entity/Event.php at line 246
EWR\Atendo\Entity\Event->_preSave() in src/XF/Mvc/Entity/Entity.php at line 1359
XF\Mvc\Entity\Entity->preSave() in src/XF/Mvc/FormAction.php at line 53
XF\Mvc\FormAction->XF\Mvc\{closure}() in src/XF/Mvc/FormAction.php at line 170
XF\Mvc\FormAction->run() in src/addons/EWR/Atendo/Pub/Controller/Event.php at line 243
EWR\Atendo\Pub\Controller\Event->actionEdit() in src/XF/Mvc/Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2352
XF\App->run() in src/XF.php at line 524
XF::runApp() in index.php at line 20
 
Getting the following error when trying to submit an event:

Code:
Error: Call to undefined method GuzzleHttp\Psr7\Response::json() in src/addons/EWR/Atendo/Repository/Google.php at line 21
EWR\Atendo\Repository\Google->fetchGeoCode() in src/addons/EWR/Atendo/Entity/Event.php at line 246
EWR\Atendo\Entity\Event->_preSave() in src/XF/Mvc/Entity/Entity.php at line 1359
XF\Mvc\Entity\Entity->preSave() in src/XF/Mvc/FormAction.php at line 53
XF\Mvc\FormAction->XF\Mvc\{closure}() in src/XF/Mvc/FormAction.php at line 170
XF\Mvc\FormAction->run() in src/addons/EWR/Atendo/Pub/Controller/Event.php at line 243
EWR\Atendo\Pub\Controller\Event->actionEdit() in src/XF/Mvc/Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2352
XF\App->run() in src/XF.php at line 524
XF::runApp() in index.php at line 20
You installed the wrong version. Install the other one.
 
@Jaxel, there are several issues that have been listed, some of which are fairly concerting with needless use of resources/calls. Have these issues been fixed and is there a newer version than what your update history here shows (last update shown to be almost 2 years ago)..
I'm looking for a decent calendar since it doesn't appear that XF will ever implement one nor social groups.
 
Idea 2:
Use a custom thread type instead of hooking into the standard discussion thread. This will save on database queries (no longer need to check for $thread->AtendoEvent which will make a db call) and also allow things like custom thread icons, simpler integration of thread header etc etc

I did this with XenPorta. My addons came out before custom thread types existed. The problem with this, is it requires a large rewrite to accomplish, and XenAtendo is just not popular enough for me to put in the time to do this. So I made the decision not to rewrite the addon for this. For XenPorta it made sense, because of how many people use it. But XenAtendo is not popular enough for the time investment.
 
Jaxel updated XF2 [8WR] XenAtendo 2 (Calendar) PRO with a new update entry:

2.2.0.3 - CHANGELOG

  • Social media linters such as Twitter and FB will now use event images as card previews if available.
    Linters will only be able to see these images, if unregistered users are able to view events.
  • Added widget positions for calendar sidebars.
  • BUG FIX: Fixed some typos in thread entities that were forcing multiple excess DB queries on event thread listings. Thank you @benFF for pointing out that I was referencing incorrect variable names in my...

Read the rest of this update entry...
 
Top Bottom