Posted: April 14, 2013 at 6:14 pm
|
I am currently using EE 3.1.31.1P and WP 3.5.1. I am using the event search short and when i type in a name of a event and the event doesn’t exist and click search I get an error on the result page rather than the usual “No events available…”. However when i just click search and I leave the textbox blank it gives me no errors and just tells me no events available. Here is the error that pops-up [code] Warning: array_slice() expects parameter 1 to be array, null given in/home/vhosts/domain/public_html/wp-content/plugins/event-espresso/templates/event_list.php on line 193 No events available… |
|
Hi Eric, Thank you for bringing this to our attention I will get a ticket raised to look into it as that error should not come up. |
|
Any update on this error at all? I am getting the same behavior. |
|
Hello, No updates as yet, this is still in the development ticket system awaiting being looked at. Once resolved we will post an update here. |
|
Any ETA about this fix? We are launching a new site with EE on Friday and would love to have the search working at the time. |
Hi Tracy — I just took a look at this and committed a fix for testing. If what I committed works, it will be in the 3.1.33 release, but I can post the change in this thread if you wanted to make the change before that version is available. |
|
|
Yes, please do. I’m extremely comfortable poking around plugin files…even attempted a fix myself, but couldn’t quite get 100% there. 🙂 |
I will let you know after it gets tested, which should be tonight. I don’t want to post code that’s going to break stuff 🙂 |
|
Hi Tracy — Here’s the fix. It’s a really simple check to see if Here’s the fix: Line 193 in $events = array_slice($events,$offset,$events_per_page); to: if ( $events ) { $events = array_slice($events,$offset,$events_per_page); } Then, for the next one, right before this, on line 269: foreach ($events as $event) { …add the check: if ( $events ) { foreach ($events as $event) { …and don’t forget to close the bracket at the end: } echo "</div>"; echo "</div>"; if ( isset( $espresso_paginate ) ) { |
|
|
Ah, this does work…but now I get “No events available…” even though there are (since they popup as the user types). Is this just a temp fix? |
|
Bump…any news? |
Can you post a link to your site so I can see what you’re talking about? This was tested and confirmed to be working and has been added to Event Espresso 3.1.33. |
|
|
Sure! It’s here: |
I don’t see the error on your page. The search uses the terms you type to bring up suggestions based on the event title. Those suggestions link to the event. The “No events available” message is a different issue, one that got overlooked when we were dealing with the |
|
The support post ‘EVENT_SEARCH Error’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.