Comments (7)
This solution doesn't work either.
But, if I just comment the following line, it works (without your two new INIT lines):
$r[$start_at]['place'] = '';
Maybe because it's initialized as a String and then we try to put an array inside...
So if it still works in your version, it's a good solution good for me. Thank you
from grav-plugin-facebook.
I had the same issue when I first starting using this. I believe it's caused by not having a place specified for the event. For example, if you're doing events at various locations (like a band or speaker) you'll always add the place. In my case I'm trying to show events happening at a single location (a bar or restaurant), they never need to add a location because all their events happen at their establishment. I'm not sure if it's the setting itself, or if it's because they're set to be the same - but it's something with that particular scenario.
Commenting out the place call in facebook.php solves it - code below. I'm looking at this thread today because I'm updating and I have to update this code every time I update the plugin. Even if this doesn't have a quick solution, Is it possible to override facebook.php? Just curious, everything else works beautifully, great job, love this plugin.
Comment out lines 273 to 285:
if (property_exists($val, 'place')) {
if (property_exists($val->place, 'name')) {
$r[$start_at]['place']['name'] = $val->place->name;
}
if (property_exists($val->place, 'location')) {
$city = '';
$country = '';
if (property_exists($val->place->location, 'city')) $city = $val->place->location->city;
if (property_exists($val->place->location, 'country')) $country = $val->place->location->country;
$r[$start_at]['place']['location'] = $city.' '.$country;
}
}
from grav-plugin-facebook.
I will get back to this probably on the next weekend.
from grav-plugin-facebook.
I couldn't reproduce your problem but I added checks to that code. Check if release 1.7.0 works better for you.
from grav-plugin-facebook.
I've got the same error with 1.7.0 after cache clean.
I was able to make it work with the following change (from line 175):
if (property_exists($val, 'place')) { $r[$start_at]['place_name'] = $val->place->name; if (property_exists($val->place, 'location')) { $r[$start_at]['place_location'] = $val->place->location; } }
And of course I used "place_name" in my template facebook.event.html.twig.
from grav-plugin-facebook.
I would like to understand the reason of this error... it is probably initialization was missing for those 2 keys. Could you try clean plugin code and just add these 2 lines. I can't understand why I am not getting error you are getting - probably something to do with PHP versions, module versions etc..
$r[$start_at]['event_link'] = $val->id;
$r[$start_at]['name'] = nl2br($val->name);
$r[$start_at]['place'] = '';
$r[$start_at]['description'] = '';
$r[$start_at]['cover'] = '';
$r[$start_at]['place']['name'] = ''; // INIT 'name'
$r[$start_at]['place']['location'] = ''; // INIT 'location'
from grav-plugin-facebook.
@cpfeifer Had the same exact issue, even though the events I was fetching do have location set (to the venue they're happening in). I commented the lines from your post and it works perfectly. Thanks!
from grav-plugin-facebook.
Related Issues (20)
- UniteGallery theme selection HOT 3
- Does not bring Fb data from facebook page HOT 7
- Posts from shared posts HOT 5
- jquery 11 breaks some Grav core HOT 4
- No images on shared posts HOT 4
- About storing events as child pages? HOT 6
- About Event code : {{ facebook_events() }} HOT 7
- Error exception after uploading website
- Error on displaying Events HOT 4
- Function facebook_posts in page HOT 15
- Seriously ? Time in string format ? HOT 2
- Day and month names in other languages than english HOT 3
- Recurring events - Show only next date
- Posts are only parsed and returned if they contain a message property HOT 1
- Gallery just imports 25 pictures HOT 3
- Error while trying to download (code: 400): https://graph.facebook.com//albums?access_token=yyyyyyyyy|xxxxxxxxxxxxxx HOT 4
- Facebook not returning events for pages using Pages API HOT 3
- FB new guidelines - app review necessary
- CRITICAL: An exception has been thrown during the rendering of a template ("Error while trying to download (code: 400) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grav-plugin-facebook.